diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-05-25 11:07:07 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-05-25 11:07:07 +0000 |
commit | b65504975c97e1ec7aadaa75dcefb42e7e70fa1f (patch) | |
tree | d50f67531259ec2ffa0180541613808b60d1c7d9 | |
parent | b0bc23a1777005ddcd54ec434f0deec88d3468fc (diff) | |
download | glibc-b65504975c97e1ec7aadaa75dcefb42e7e70fa1f.zip glibc-b65504975c97e1ec7aadaa75dcefb42e7e70fa1f.tar.gz glibc-b65504975c97e1ec7aadaa75dcefb42e7e70fa1f.tar.bz2 |
Fix acosf underflow (bug 14153).
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | math/libm-test.inc | 3 | ||||
-rw-r--r-- | sysdeps/ieee754/flt-32/e_acosf.c | 2 |
4 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,11 @@ +2012-05-24 Joseph Myers <joseph@codesourcery.com> + + [BZ #14153] + * sysdeps/ieee754/flt-32/e_acosf.c (__ieee754_acosf): Return pi/2 + for |x| <= 2**-26, not 2**-57. + * math/libm-test.inc (acos_test): Do not allow spurious underflow + exception. + 2012-05-24 Jeff Law <law@redhat.com> * stdio-common/Makefile (tests): Add bug25. @@ -28,7 +28,7 @@ Version 2.16 13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973, 13979, 13983, 13986, 14012, 14027, 14033, 14034, 14036, 14040, 14043, 14044, 14049, 14053, 14055, 14059, 14064, 14080, 14083, 14103, 14104, - 14109, 14122, 14123 + 14109, 14122, 14123, 14153 * ISO C11 support: diff --git a/math/libm-test.inc b/math/libm-test.inc index 5946ca8..ed13f53 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -804,8 +804,7 @@ acos_test (void) TEST_f_f (acos, 0.5, M_PI_6l*2.0); TEST_f_f (acos, -0.5, M_PI_6l*4.0); TEST_f_f (acos, 0.75L, 0.722734247813415611178377352641333362L); - /* Bug 14153: spurious exception may occur. */ - TEST_f_f (acos, 2e-17L, 1.57079632679489659923132169163975144L, UNDERFLOW_EXCEPTION_OK_FLOAT); + TEST_f_f (acos, 2e-17L, 1.57079632679489659923132169163975144L); TEST_f_f (acos, 0.0625L, 1.50825556499840522843072005474337068L); TEST_f_f (acos, 0x0.ffffffp0L, 3.4526698471620358760324948263873649728491e-4L); TEST_f_f (acos, -0x0.ffffffp0L, 3.1412473866050770348750401337968641476999L); diff --git a/sysdeps/ieee754/flt-32/e_acosf.c b/sysdeps/ieee754/flt-32/e_acosf.c index c0f1d4e..6f792f6 100644 --- a/sysdeps/ieee754/flt-32/e_acosf.c +++ b/sysdeps/ieee754/flt-32/e_acosf.c @@ -46,7 +46,7 @@ __ieee754_acosf(float x) return (x-x)/(x-x); /* acos(|x|>1) is NaN */ } if(ix<0x3f000000) { /* |x| < 0.5 */ - if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/ + if(ix<=0x32800000) return pio2_hi+pio2_lo;/*if|x|<=2**-26*/ z = x*x; p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); |