glibc/sysdeps
Joseph Myers f88acd39da Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293).
Bug 16293 is inaccuracy of x86/x86_64 versions of expm1, near 0 in
directed rounding modes, that arises from frndint rounding the
exponent to 1 or -1 instead of 0, resulting in large cancellation
error.  This inaccuracy in turn affects other functions such as sinh
that use expm1.  This patch fixes the problem by setting
round-to-nearest mode temporarily around the affected calls to
frndint.  I don't think this is needed for other uses of frndint, such
as in exp itself, as only for expm1 is the cancellation error
significant.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Set
	round-to-nearest mode when using frndint.
	* sysdeps/i386/fpu/s_expm1.S (__expm1): Likewise.
	* sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise.
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
	Likewise.
	* math/auto-libm-test-in: Add more tests of expm1.  Do not expect
	sinh test to fail.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (TEST_COND_x86_64): Remove macro.
	(TEST_COND_x86): Likewise.
	(expm1_tonearest_test_data): New array.
	(expm1_test_tonearest): New function.
	(expm1_towardzero_test_data): New array.
	(expm1_test_towardzero): New function.
	(expm1_downward_test_data): New array.
	(expm1_test_downward): New function.
	(expm1_upward_test_data): New array.
	(expm1_test_upward): New function.
	(main): Run the new test functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-19 13:36:10 +00:00
..
generic Patch 2/4 of the effort to make TLS access async-signal-safe. 2013-12-18 16:46:18 -08:00
gnu Remove __FAVOR_BSD. 2013-12-17 18:05:57 +00:00
i386 Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293). 2013-12-19 13:36:10 +00:00
ieee754 Compile e_sqrt.c with -ffp-contract=off. 2013-12-18 12:07:06 +00:00
init_array
mach Patch [1/4] async-signal safe TLS. 2013-12-18 15:07:11 -08:00
posix Remove redundant GAIH_OKIFUNSPEC and GAIH_EAI. 2013-12-02 20:23:13 +05:30
powerpc Update powerpc-fpu ULPs. 2013-12-17 10:23:00 -06:00
pthread
s390 [BZ #16214] S/390: Fix TLS GOT pointer setup. 2013-11-29 09:57:04 +01:00
sh Make soft-float sh use soft-fp fma/fmaf. 2013-12-17 09:00:05 +09:00
sparc Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
unix Patch [1/4] async-signal safe TLS. 2013-12-18 15:07:11 -08:00
wordsize-32
wordsize-64
x86 Use __glibc_reserved instead __unused. 2013-11-26 12:32:28 +01:00
x86_64 Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293). 2013-12-19 13:36:10 +00:00