mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-13 00:30:07 +00:00
e02920bc02
In non-default rounding modes, tgamma can be slightly less accurate than permitted by glibc's accuracy goals. Part of the problem is error accumulation, addressed in this patch by setting round-to-nearest for internal computations. However, there was also a bug in the code dealing with computing pow (x + n, x + n) where x + n is not exactly representable, providing another source of error even in round-to-nearest mode; it was necessary to address both bugs to get errors for all testcases within glibc's accuracy goals. Given this second fix, accuracy in round-to-nearest mode is also improved (hence regeneration of ulps for tgamma should be from scratch - truncate libm-test-ulps or at least remove existing tgamma entries - so that the expected ulps can be reduced). Some additional complications also arose. Certain tgamma tests should strictly, according to IEEE semantics, overflow or not depending on the rounding mode; this is beyond the scope of glibc's accuracy goals for any function without exactly-determined results, but gen-auto-libm-tests doesn't handle being lax there as it does for underflow. (libm-test.inc also doesn't handle being lax about whether the result in cases very close to the overflow threshold is infinity or a finite value close to overflow, but that doesn't cause problems in this case though I've seen it cause problems with random test generation for some functions.) Thus, spurious-overflow markings, with a comment, are added to auto-libm-test-in (no bug in Bugzilla because the issue is with the testsuite, not a user-visible bug in glibc). And on x86, after the patch I saw ERANGE issues as previously reported by Carlos (see my commentary in <https://sourceware.org/ml/libc-alpha/2015-01/msg00485.html>), which needed addressing by ensuring excess range and precision were eliminated at various points if FLT_EVAL_METHOD != 0. I also noticed and fixed a cosmetic issue where 1.0f was used in long double functions and should have been 1.0L. This completes the move of all functions to testing in all rounding modes with ALL_RM_TEST, so gen-libm-have-vector-test.sh is updated to remove the workaround for some functions not using ALL_RM_TEST. Tested for x86_64, x86, mips64 and powerpc. [BZ #18613] * sysdeps/ieee754/dbl-64/e_gamma_r.c (gamma_positive): Take log of X_ADJ not X when adjusting exponent. (__ieee754_gamma_r): Do intermediate computations in round-to-nearest then adjust overflowing and underflowing results as needed. * sysdeps/ieee754/flt-32/e_gammaf_r.c (gammaf_positive): Take log of X_ADJ not X when adjusting exponent. (__ieee754_gammaf_r): Do intermediate computations in round-to-nearest then adjust overflowing and underflowing results as needed. * sysdeps/ieee754/ldbl-128/e_gammal_r.c (gammal_positive): Take log of X_ADJ not X when adjusting exponent. (__ieee754_gammal_r): Do intermediate computations in round-to-nearest then adjust overflowing and underflowing results as needed. Use 1.0L not 1.0f as numerator of division. * sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c (gammal_positive): Take log of X_ADJ not X when adjusting exponent. (__ieee754_gammal_r): Do intermediate computations in round-to-nearest then adjust overflowing and underflowing results as needed. Use 1.0L not 1.0f as numerator of division. * sysdeps/ieee754/ldbl-96/e_gammal_r.c (gammal_positive): Take log of X_ADJ not X when adjusting exponent. (__ieee754_gammal_r): Do intermediate computations in round-to-nearest then adjust overflowing and underflowing results as needed. Use 1.0L not 1.0f as numerator of division. * math/libm-test.inc (tgamma_test_data): Remove one test. Moved to auto-libm-test-in. (tgamma_test): Use ALL_RM_TEST. * math/auto-libm-test-in: Add one test of tgamma. Mark some other tests of tgamma with spurious-overflow. * math/auto-libm-test-out: Regenerated. * math/gen-libm-have-vector-test.sh: Do not check for START. * 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 | ||
Makefile | ||
math_ldbl.h | ||
math_private.h | ||
math-tests-arch.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 | ||
svml_d_cos2_core.S | ||
svml_d_cos4_core_avx.S | ||
svml_d_cos4_core.S | ||
svml_d_cos8_core.S | ||
svml_d_exp2_core.S | ||
svml_d_exp4_core_avx.S | ||
svml_d_exp4_core.S | ||
svml_d_exp8_core.S | ||
svml_d_exp_data.h | ||
svml_d_exp_data.S | ||
svml_d_log2_core.S | ||
svml_d_log4_core_avx.S | ||
svml_d_log4_core.S | ||
svml_d_log8_core.S | ||
svml_d_log_data.h | ||
svml_d_log_data.S | ||
svml_d_pow2_core.S | ||
svml_d_pow4_core_avx.S | ||
svml_d_pow4_core.S | ||
svml_d_pow8_core.S | ||
svml_d_pow_data.h | ||
svml_d_pow_data.S | ||
svml_d_sin2_core.S | ||
svml_d_sin4_core_avx.S | ||
svml_d_sin4_core.S | ||
svml_d_sin8_core.S | ||
svml_d_sincos2_core.S | ||
svml_d_sincos4_core_avx.S | ||
svml_d_sincos4_core.S | ||
svml_d_sincos8_core.S | ||
svml_d_trig_data.h | ||
svml_d_trig_data.S | ||
svml_d_wrapper_impl.h | ||
svml_s_cosf4_core.S | ||
svml_s_cosf8_core_avx.S | ||
svml_s_cosf8_core.S | ||
svml_s_cosf16_core.S | ||
svml_s_expf4_core.S | ||
svml_s_expf8_core_avx.S | ||
svml_s_expf8_core.S | ||
svml_s_expf16_core.S | ||
svml_s_expf_data.h | ||
svml_s_expf_data.S | ||
svml_s_logf4_core.S | ||
svml_s_logf8_core_avx.S | ||
svml_s_logf8_core.S | ||
svml_s_logf16_core.S | ||
svml_s_logf_data.h | ||
svml_s_logf_data.S | ||
svml_s_powf4_core.S | ||
svml_s_powf8_core_avx.S | ||
svml_s_powf8_core.S | ||
svml_s_powf16_core.S | ||
svml_s_powf_data.h | ||
svml_s_powf_data.S | ||
svml_s_sincosf4_core.S | ||
svml_s_sincosf8_core_avx.S | ||
svml_s_sincosf8_core.S | ||
svml_s_sincosf16_core.S | ||
svml_s_sinf4_core.S | ||
svml_s_sinf8_core_avx.S | ||
svml_s_sinf8_core.S | ||
svml_s_sinf16_core.S | ||
svml_s_trig_data.h | ||
svml_s_trig_data.S | ||
svml_s_wrapper_impl.h | ||
test-double-vlen2-wrappers.c | ||
test-double-vlen2.c | ||
test-double-vlen4-avx2-wrappers.c | ||
test-double-vlen4-avx2.c | ||
test-double-vlen4-wrappers.c | ||
test-double-vlen4.c | ||
test-double-vlen8-wrappers.c | ||
test-double-vlen8.c | ||
test-float-vlen4-wrappers.c | ||
test-float-vlen4.c | ||
test-float-vlen8-avx2-wrappers.c | ||
test-float-vlen8-avx2.c | ||
test-float-vlen8-wrappers.c | ||
test-float-vlen8.c | ||
test-float-vlen16-wrappers.c | ||
test-float-vlen16.c | ||
Versions |