freebsd-dev/lib/msun
Bruce Evans 11cba99f67 Fix numerous errors of >= 1 ulp for cosf(x) and sinf(x) (1 line)
and add a comment about related magic (many lines)).

__kernel_cos[f]() needs a trick to reduce the error to below 1 ulp
when |x| >= 0.3 for the range-reduced x.  Modulo other bugs, naive
code that doesn't use the trick would have an error of >= 1 ulp
in about 0.00006% of cases when |x| >= 0.3 for the unreduced x,
with a maximum relative error of about 1.03 ulps.  Mistransation
of the trick from the double precision case resulted in errors in
about 0.2% of cases, with a maximum relative error of about 1.3 ulps.

The mistranslation involved not doing implicit masking of the 32-bit
float word corresponding to to implicit masking of the lower 32-bit
double word by clearing it.

sinf() uses __kernel_cosf() for half of all cases so its errors from
this bug are similar.  tanf() is not affected.

The error bounds in the above and in my other recent commit messages
are for amd64.  Extra precision for floats on i386's accidentally masks
this bug, but only if k_cosf.c is compiled with -O.  Although the extra
precision helps here, this is accidental and depends on longstanding
gcc precision bugs (not clipping extra precision on assignment...),
and the gcc bugs are mostly avoided by compiling without -O.  I now
develop libm mainly on amd64 systems to simplify error detection and
debugging.
2005-10-09 21:07:23 +00:00
..
alpha
amd64 Add a missing ldexpf() alias for amd64. 2005-09-12 20:54:00 +00:00
arm
bsdsrc Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access 2005-09-19 11:28:19 +00:00
i387
ia64
man Markup nit. 2005-06-16 21:56:03 +00:00
powerpc
sparc64
src Fix numerous errors of >= 1 ulp for cosf(x) and sinf(x) (1 line) 2005-10-09 21:07:23 +00:00
Makefile Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00