lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear Sir,

For small x << 1, there is loss of several digits of precision when calculating exp(x)-1 from exp(x), because we are taking the difference of two numbers almost equal to each other and to 1. Likewise there is similar error in computing ln(1+x), sinh(x), asinh(x), tanh(x) etc for small x.

ANSI Forth, C and x87 FPU provide the instructions expm1(x) and log1p(x) to meet this need. Furthermore given these two functions one can compute all hyperbolic functions for the entire range of x, which is of use and interest in scientific applications of Lua. Therefore I request that expm1 and log1p be provided in Lua.

sjain59