You are correct! However, Apple's original "SANE" library, on which Kahan consulted (I believe), _did_ have exp1(x) & log1(x), because without them, it is nearly impossible to get decent results when computing compound interest. http://developer.apple.com/documentation/mac/PPCNumerics/PPCNumerics-168.htm... I believe that Kahan also consulted on the Intel 80387 floating point coprocessor, which I believe also has these two functions. The sad part is that these two functions haven't made it into high school curricula, so that students can learn a little about numerical analysis. At 07:15 PM 8/1/2008, Mike Speciner wrote:
But I wondered why the standard floating point math libraries (at least the ones I know about) don't provide exp(x)-1 and ln(1+x). Each of these functions is approximately x for small x, and so would avoid the loss of precision when adding 1 to a small number. (If one already has hyperbolic functions, then I suppose exp(x)-1 = sinh(x) (1 + sinh(x)/(cosh(x)+1)), and log(1+x) = 2 atanh(x/(2+x)).)
--ms