Anyone interested in the gory details of how elementary functions are
calculated in floating-point arithmetic might take a look at fdlibm, in
particular

http://netlib.org/fdlibm/e_exp.c

which is the source for exp.  This demonstrates two common techniques:
argument reduction, and using interpolation based on polynomials with
precomputed coefficients.  The polynomials tend not to be Taylor
polynomials (which minimize error near a point) but Chebyshev polynomials
(which minimize mean square error over an interval).

The code here claims to have error less than 1 ulp (unit in the last place).

Best wishes,

John

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to