Fast vectorizable math functions approximations
- January 26, 2015
- Last updated on 2015/01/27
How and why I designed my own approximated implementations of
log
, exp
, sin
and
cos
. The approximation error is quite small, and the
functions are fast and vectorizable. For example, my
logapprox
function is 7.5x faster in tight loops than the
icsi_log
function, while being more precise.
Left-recursive versus right-recursive lists in LR parsers
- January 21, 2015
- Last updated on 2015/01/22
Contrary to top-down (LL) parsers, which do not support left recursion, bottom-up (LR) parsers support both left recursion and right recursion. When defining a list-like construct, a user of an LR parser generator, such as Menhir, faces a choice between these two flavors. Which one should she prefer?
Two considerations guide this choice: expressiveness (which flavor leads to fewer conflicts?) and performance (which flavor leads to a more efficient parser?).
In this post, I am mainly interested in discussing expressiveness. I also comment on performance in the setting of Menhir.
As we will see, the bottom line is that neither formulation seems deeply preferable to the other.