Error of tan/tanf in libm.

Stephen L Moshier
Sat Apr 14 19:38:00 GMT 2001

> The only libm functions in newlib which I've found to be substandard
> are acosf() / asinf().

newlib-1.9 has at least two versions: newlib/libm/math/ef_asin.c,
newlib/libm/mathfp/sf_asine.c.  Are you referring to one of these?
sf_asine.c seems to have about 2 ulps relative error, ef_asin.c
has 3 ulps.

The main problem with ef_asin.c is that the values
of pio2_hi, pio2_lo, pio4_hi are chosen incorrectly for IEEE
(strictly rounded) arithmetic.  If someone would like a patch
to fix ef_asin.c, I can give you one written for the file e_asinf.c in
glibc which I think is the same code.  The fix yields less than 1 ulp
relative error.

More information about the Newlib mailing list