5b0626b9c5
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. |
||
---|---|---|
.. | ||
multiarch | ||
dla.h | ||
e_acosl.c | ||
e_atan2l.c | ||
e_exp2l.S | ||
e_exp10l.S | ||
e_expf.S | ||
e_expl.S | ||
e_fmodl.S | ||
e_ilogbl.S | ||
e_log2l.S | ||
e_log10l.S | ||
e_logl.S | ||
e_powl.S | ||
e_remainderl.S | ||
e_scalbl.S | ||
e_sqrt.c | ||
e_sqrtf.c | ||
e_sqrtl.c | ||
fclrexcpt.c | ||
fedisblxcpt.c | ||
feenablxcpt.c | ||
fegetenv.c | ||
fegetexcept.c | ||
fegetround.c | ||
feholdexcpt.c | ||
fesetenv.c | ||
fesetround.c | ||
feupdateenv.c | ||
fgetexcptflg.c | ||
fraiseexcpt.c | ||
fsetexcptflg.c | ||
ftestexcept.c | ||
Implies | ||
k_rem_pio2l.c | ||
libm-test-ulps | ||
math_ldbl.h | ||
math_private.h | ||
printf_fphex.c | ||
s_atanl.c | ||
s_ceill.S | ||
s_copysign.S | ||
s_copysignf.S | ||
s_copysignl.S | ||
s_cosf.S | ||
s_expm1l.S | ||
s_fabs.c | ||
s_fabsf.c | ||
s_fabsl.S | ||
s_fdiml.S | ||
s_finitel.S | ||
s_floorl.S | ||
s_fmax.S | ||
s_fmaxf.S | ||
s_fmaxl.S | ||
s_fmin.S | ||
s_fminf.S | ||
s_fminl.S | ||
s_fpclassifyl.c | ||
s_isinfl.c | ||
s_isnanl.c | ||
s_llrint.S | ||
s_llrintf.S | ||
s_llrintl.S | ||
s_log1pl.S | ||
s_logbl.c | ||
s_lrint.S | ||
s_lrintf.S | ||
s_lrintl.S | ||
s_nearbyintl.S | ||
s_nextafterl.c | ||
s_nexttoward.c | ||
s_nexttowardf.c | ||
s_rintl.c | ||
s_scalbnl.S | ||
s_signbit.S | ||
s_signbitf.S | ||
s_significandl.c | ||
s_sincosf.S | ||
s_sinf.S | ||
s_truncl.S |