about summary refs log tree commit diff
path: root/math/auto-libm-test-in
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-12-21 13:07:16 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-12-21 13:07:16 +0000
commit5b0626b9c50e69fe4d7dce90199d78f398c249b1 (patch)
tree670c05d54f1077faf9cc39577449e67eba964a9f /math/auto-libm-test-in
parent31e3a40588f6b215f2583c12ba29ff5cea63d2ef (diff)
downloadglibc-5b0626b9c50e69fe4d7dce90199d78f398c249b1.tar.gz
glibc-5b0626b9c50e69fe4d7dce90199d78f398c249b1.tar.xz
glibc-5b0626b9c50e69fe4d7dce90199d78f398c249b1.zip
Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356).
This patch fixes bug 16356, bad results from x86 / x86_64 expl /
exp10l in directed rounding modes, the most serious of the bugs shown
up by my patch expanding libm test coverage.  When I fixed bug 16293,
I thought it was only necessary to set round-to-nearest when using
frndint in expm1 functions, because in other cases the cancellation
error from having the resulting fractional part close to 1 or -1 would
not be significant.  However, in expl and exp10l, the way the final
fractional part gets computed (something more complicated than a
simple subtraction, because more precision is needed than you'd get
that way) can result in a value outside the range [-1, 1] when the
argument to frndint was very close to an integer and was rounded the
"wrong" way because of the rounding mode - and the f2xm1 instruction
has undefined results if its argument is outside [-1, 1], so resulting
in the large errors seen.  So this patch removes the USE_AS_EXPM1L
conditionals on the round-to-nearest settings, so all of expl, expm1l
and exp10l now get round-to-nearest used for frndint (meaning the
final fractional part can at most be slightly above 0.5 in
magnitude).  Associated tests of exp and exp10 are added and testing
of exp10 in directed rounding modes enabled.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL): Also set
	round-to-nearest for [!USE_AS_EXPM1L].
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL): Likewise.
	* math/auto-libm-test-in: Do not expect cosh tests to fail.  Add
	more tests of exp and exp10.  Expect some exp10 tests to miss
	exceptions or fail in directed rounding modes.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (exp10_tonearest_test_data): New array.
	(exp10_test_tonearest): New function.
	(exp10_towardzero_test_data): New array.
	(exp10_test_towardzero): New function.
	(exp10_downward_test_data): New array.
	(exp10_test_downward): New function.
	(exp10_upward_test_data): New array.
	(exp10_test_upward): New function.
	(main): Call the new functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Diffstat (limited to 'math/auto-libm-test-in')
-rw-r--r--math/auto-libm-test-in27
1 files changed, 17 insertions, 10 deletions
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 532b17e4a8..c6cc3e35d3 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -519,11 +519,10 @@ cosh 0x2.c679d1f73f0fap+8
 cosh 0x2.c679d1f73f0fcp+8
 cosh -0x2.c679d1f73f0fap+8
 cosh -0x2.c679d1f73f0fcp+8
-# Bug 16356: bad results from expl (and so coshl) in round-upward mode.
-cosh 0x2.c679d1f73f0fb624d358b213a7p+8 xfail-rounding:ldbl-96-intel:x86 xfail-rounding:ldbl-96-intel:x86_64
-cosh 0x2.c679d1f73f0fb624d358b213a8p+8 xfail-rounding:ldbl-96-intel:x86 xfail-rounding:ldbl-96-intel:x86_64
-cosh -0x2.c679d1f73f0fb624d358b213a7p+8 xfail-rounding:ldbl-96-intel:x86 xfail-rounding:ldbl-96-intel:x86_64
-cosh -0x2.c679d1f73f0fb624d358b213a8p+8 xfail-rounding:ldbl-96-intel:x86 xfail-rounding:ldbl-96-intel:x86_64
+cosh 0x2.c679d1f73f0fb624d358b213a7p+8
+cosh 0x2.c679d1f73f0fb624d358b213a8p+8
+cosh -0x2.c679d1f73f0fb624d358b213a7p+8
+cosh -0x2.c679d1f73f0fb624d358b213a8p+8
 cosh 0x2.c5d37700c6bb03a4p+12 no-test-inline
 cosh 0x2.c5d37700c6bb03a8p+12 no-test-inline
 cosh -0x2.c5d37700c6bb03a4p+12 no-test-inline
@@ -712,6 +711,7 @@ exp 1000.0 xfail-rounding:dbl-64
 exp 710 xfail-rounding:dbl-64
 exp -1234
 # Bug 16284: results on directed rounding may be incorrect.
+exp 0x2.c679d1f73f0fb628p+8 xfail-rounding:dbl-64
 exp 1e5 xfail-rounding:dbl-64
 exp max xfail-rounding:dbl-64
 exp -7.4444006192138124e+02
@@ -726,15 +726,22 @@ exp10 36
 exp10 -36
 exp10 305
 exp10 -305
-exp10 4932
-exp10 -4932
-exp10 1e5
+# Bug 16284: results on directed rounding may be incorrect.
+exp10 4932 xfail-rounding:flt-32
+# Bug 16361: underflow exception may be misssing
+exp10 -4932 missing-underflow:ldbl-96-intel:x86 missing-underflow:ldbl-96-intel:x86_64
+# Bug 16284: results on directed rounding may be incorrect.
+exp10 1e5 xfail-rounding:flt-32
 exp10 -1e5
-exp10 1e6
+# Bug 16284: results on directed rounding may be incorrect.
+exp10 1e6 xfail-rounding:flt-32
 exp10 -1e6
-exp10 max
+# Bug 16284: results on directed rounding may be incorrect.
+exp10 max xfail-rounding:flt-32
 exp10 -max
 exp10 0.75
+# Bug 16284: results on directed rounding may be incorrect.
+exp10 0x1.348e45573a1dd72cp+8 xfail-rounding:flt-32 xfail-rounding:dbl-64
 
 exp2 0
 exp2 -0