|
From: Greg C. <chi...@co...> - 2005-01-18 12:28:25
|
log1p() would be much more useful if its companion expm1() [C99 7.12.6.3] were provided as well. Is there a reason not to have expm1(), other than "no one has contributed it yet"? For instance, Conklin, credited as the original author of /mingw/runtime/mingwex/math/log1pl.S?rev=1.1&view=markup said in an earlier version http://www.klid.dk/pub/gnu/gnu-utils/src/libm/src/s_log1p.s /* * Since the fyl2xp1 instruction has such a limited range: * -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1 * it's not worth trying to use it. */ but apparently later realized its worth. Did something like that happen for expm1()? Hmm...I find Conklin's log1p() in the netbsd src/lib/libm sources, but no corresponding expm1(). I realize expm1() will be an intrinsic in gcc-4.0 http://www.gnu.org/software/gcc/gcc-4.0/changes.html but apparently only with '-ffast-math', so there's still a use for an expm1() that conforms to the language and numeric standards. |