This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Error of tan/tanf in libm.
- To: "J. Johnston" <jjohnstn at cygnus dot com>
- Subject: Re: Error of tan/tanf in libm.
- From: Stephen L Moshier <moshier at mediaone dot net>
- Date: Mon, 16 Apr 2001 21:46:02 -0400 (EDT)
- cc: Tim Prince <tprince at computer dot org>, newlib at sources dot redhat dot com
- Reply-To: moshier at moshier dot ne dot mediaone dot net
On Mon, 16 Apr 2001, J. Johnston wrote:
> Thanks for the patch Stephen.
I should have pointed out why the change accomplishes anything.
If you look at this code near the end of the program,
p = 2.0 * s * r - (pio2_lo - 2.0 * c);
q = pio4_hi - 2.0 * w;
t = pio4_hi - (p - q);
you see that pio2_lo plus twice pio4_hi is supposed to equal pi/2
to extra precision. But also pio2_lo plus pio2_hi is supposed
to be the same thing. Therefore pio4_hi must be exactly half
of pio2_hi, which was not the case.