glibc/sysdeps/x86_64/fpu
Joseph Myers 5b0626b9c5 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.
2013-12-21 13:07:16 +00:00
..
multiarch Use x constraints for operands to vfmaddss and vfmaddsd 2013-05-15 20:31:53 +02:00
dla.h Better DLA_FMS 2011-10-24 22:11:21 -04:00
e_acosl.c
e_atan2l.c
e_exp2l.S Optimize libm 2011-10-12 11:27:51 -04:00
e_exp10l.S Fix exp10 inaccuracy and exceptions (bugs 13884, 13914). 2012-05-06 18:23:44 +00:00
e_expf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_expl.S Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
e_fmodl.S Optimize libm 2011-10-12 11:27:51 -04:00
e_ilogbl.S Remove useless __ilogb*_finite aliases 2012-04-18 00:40:13 +02:00
e_log2l.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log10l.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_logl.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_powl.S Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167). 2013-11-16 12:45:11 +00:00
e_remainderl.S Optimize libm 2011-10-12 11:27:51 -04:00
e_scalbl.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_sqrt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_sqrtf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_sqrtl.c
fclrexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fedisblxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feenablxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetround.c Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
feholdexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fesetenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fesetround.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feupdateenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fgetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fraiseexcpt.c Fix typos. 2013-08-21 19:48:48 +02:00
fsetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ftestexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Implies Use x86_64 fpu/bits/fenv.h for i386 and x86_64 2012-06-06 10:13:19 -07:00
k_rem_pio2l.c Dummy files to prevent stub versions from being used. 2007-05-17 18:39:55 +00:00
libm-test-ulps Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
math_ldbl.h
math_private.h Use movq for 64-bit operations 2013-05-15 20:33:45 +02:00
printf_fphex.c PowerPC floating point little-endian [1 of 15] 2013-10-04 10:31:41 +09:30
s_atanl.c
s_ceill.S Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_copysign.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_copysignf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_copysignl.S
s_cosf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_expm1l.S Fix x86/x86_64 expm1l inaccuracy and exceptions (bugs 13885, 13923). 2012-05-07 19:13:08 +00:00
s_fabs.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fabsf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fabsl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fdiml.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_finitel.S Update. 2002-09-10 01:40:26 +00:00
s_floorl.S Update. 2003-11-18 07:25:02 +00:00
s_fmax.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmin.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fpclassifyl.c
s_isinfl.c
s_isnanl.c
s_llrint.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintl.S Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_log1pl.S Remove __ELF__ conditionals 2012-02-07 00:41:11 +01:00
s_logbl.c
s_lrint.S
s_lrintf.S
s_lrintl.S
s_nearbyintl.S Update. 2003-11-18 07:25:02 +00:00
s_nextafterl.c
s_nexttoward.c
s_nexttowardf.c
s_rintl.c
s_scalbnl.S Update. 2003-11-18 07:25:02 +00:00
s_signbit.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_signbitf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_significandl.c
s_sincosf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_sinf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_truncl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00