freebsd-dev/lib/msun
Bruce Evans 51f86873af Use double precision for z and thus for the entire calculation of
exp2(i/TBLSIZE) * p(z) instead of only for the final multiplication
and addition.  This fixes the code to match the comment that the maximum
error is 0.5010 ulps (except on machines that evaluate float expressions
in extra precision, e.g., i386's, where the evaluation was already
in extra precision).

Fix and expand the comment about use of double precision.

The relative roundoff error from evaluating p(z) in non-extra precision
was about 16 times larger than in exp2() because the interval length
is 16 times smaller.  Its maximum was at least P1 * (1.0 ulps) *
max(|z|) ~= log(2) * 1.0 * 1/32 ~= 0.0217 ulps (1.0 ulps from the
addition in (1 + P1*z) with a cancelation error when z ~= -1/32).  The
actual final maximum was 0.5313 ulps, of which 0.0303 ulps must have
come from the additional roundoff error in p(z).  I can't explain why
the additional roundoff error was almost 3/2 times larger than the rough
estimate.
2008-02-11 05:20:02 +00:00
..
amd64 Implement rintl(), nearbyintl(), lrintl(), and llrintl(). 2008-01-14 02:12:07 +00:00
arm Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
bsdsrc Fix tgamma() on some special args: 2007-05-02 15:24:49 +00:00
i387 Implement rintl(), nearbyintl(), lrintl(), and llrintl(). 2008-01-14 02:12:07 +00:00
ia64 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
ld80 Use a better method of scaling by 2**k. Instead of adding to the 2008-02-07 03:17:05 +00:00
ld128 Use a better method of scaling by 2**k. Instead of adding to the 2008-02-07 03:17:05 +00:00
man Introduce a new log(3) manpage and move the relevant functions there. 2008-01-18 21:43:00 +00:00
powerpc Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
sparc64 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
src Use double precision for z and thus for the entire calculation of 2008-02-11 05:20:02 +00:00
Makefile Hook up exp2l() and related docs to the build. 2008-01-18 21:43:10 +00:00
Symbol.map Hook up exp2l() and related docs to the build. 2008-01-18 21:43:10 +00:00