This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix tanf underflow close to pi/4 (bug 14154)
On 07/06/2012 09:25 PM, Joseph S. Myers wrote:
Bug 14154 is a spurious underflow exception from tanf on arguments
very close to an odd multiple of pi/4. Where x is the distance of the
argument from an odd multiple of pi/4, the underflowing operation in
__kernel_tanf is
r = y + z*(s*(r+v)+y);
where z is x squared and s is x cubed, y is 0 and r+v is small enough
that the multiple of the fifth power of x can underflow. This patch
fixes the spurious exception by using a linear approximation when the
argument is close enough to pi/4 for the higher-order terms to be <
0.5ulp of the result. The tests added are the closest binary values
above and below pi/4 and -pi/4, for each number of bits from 8 to 24,
to provide coverage of a range of values close to pi/4 and -pi/4.
Tested x86 and x86_64 and ulps updated accordingly. (My testing did
not show any need to update any ulps on x86_64.)
Ok, thanks,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126