From e4e52ff059f46472145433d2bd003d5383f89e82 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 15 Mar 2017 22:00:54 +0000 Subject: Improve float range reduction accuracy near pi/2 (bug 21094). Bug 21094 reports 3ulp errors of cosf and tanf for certain arguments near pi/2 arising from the use of an insufficiently accurate range reduction. (To be clear, this is a quality-of-implementation issue relating to the apparent intent of those particular cosf and tanf implementations; 3ulp is within the general glibc accuracy goals, so not inherently a bug.) This patch fixes that error by making a wider range of cases use the existing more accurate range reduction for arguments close to pi/2. The wider range of values is still narrow enough for the "z -= pio2_2;" in the more accurate case to be exact, as the code expects. Tested for x86_64, x86 and mips64; no ulps updates needed (but at least on mips64, the larger ulps were seen if the tests were added without the substantive fix). [BZ #21094] * sysdeps/ieee754/flt-32/e_rem_pio2f.c (__ieee754_rem_pio2f): Use 24+24+24-bit pi for wider range of values around pi/2. * math/auto-libm-test-in: Add more tests of cos and tan. * math/auto-libm-test-out-cos: Regenerated. * math/auto-libm-test-out-tan: Likewise. --- ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index f8b2e60bd6..f1f9ceb7ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2017-03-15 Joseph Myers + + [BZ #21094] + * sysdeps/ieee754/flt-32/e_rem_pio2f.c (__ieee754_rem_pio2f): Use + 24+24+24-bit pi for wider range of values around pi/2. + * math/auto-libm-test-in: Add more tests of cos and tan. + * math/auto-libm-test-out-cos: Regenerated. + * math/auto-libm-test-out-tan: Likewise. + 2017-03-15 John David Anglin * sysdeps/hppa/dl-machine.h (DL_STACK_END): Define. -- cgit 1.4.1