FR: Math.ExpM1.
I sort of need the inverse of LnXP1
(I suspect that some percentage of the people that use LnXP1
need the inverse as well). Same AMath library from where current LnXP1
originates has the implementation but unlike LnXP1
it does not mean “easy and self-sufficient part that reduces to the base function with a few extra operations” for close-to-zero cases.
Moreover, it has separate versions for double
s and extended
s and generally warns against using the latter instead of the former, but I see no problems, save for speed. After all, I used the version from Boost based on ordinary polynomials (AMath used it only for double
s), because Chebyshev polynomials (which it used for extended
s) are slower for me and require a completely separate subroutine instead of reusing PolyEval
. Still, Boost version is an overkill for 80-bit floats because it is designed for 128-bit precision, so a smaller polynomial can be used one day, if you find one...