glibc/sysdeps/ieee754/ldbl-128
Jakub Jelinek 63c99cd50b math: Fix up THREEp96 constant in expf128 [BZ #32411]
As mentioned by the reporter in a pull request against gcc-mirror,
the THREEp96 constant in e_expl.c is incorrect, it is actually 0x3.p+94f128
rather than 0x3.p+96f128.

The algorithm uses that to compute the t2 integer (tval2), by whose
delta it adjusts the x+xl pair and then in the result uses the precomputed
exp value for that entry.
Using 0x3.p+94f128 rather than 0x3.p+96f128 results in tval2 sometimes
being one smaller, sometimes one larger than the desired value, thus can mean
the x+xl pair after adjustment will be larger in absolute value than it
should be.

DesWursters created a test program for this
https://github.com/DesWurstes/comparefloats
and his results were
total: 1135000000 not_equal: 4322 earlier_score: 674 later_score: 3648
I've modified this so with
https://sourceware.org/bugzilla/show_bug.cgi?id=32411#c3
so that it actually tests pseudo-random _Float128 values with range
(-16384.,16384) with strong bias on values larger than 0.0002 in absolute
value (so that tval1/tval2 aren't zero most of the time) and that gave
total: 10000000000 not_equal: 29861 earlier_score: 4606 later_score: 25255
So, in both cases, in most cases the change doesn't result in any differences,
and in those rare cases where does, about 85% have smaller ulp than without
the patch.
Additionally I've tried
https://sourceware.org/bugzilla/show_bug.cgi?id=32411#c4
and in 2 billion iterations it didn't find any case where x+xl after the
adjustments without this change would be smaller in absolute value compared
to x+xl after the adjustments with this change.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-04-09 18:24:11 +02:00
..
bits Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Makeconfig
Makefile stdio-common: Add scanf long double data for IEEE 754 binary128 format 2025-03-25 09:40:20 +00:00
e_acoshl.c
e_acosl.c
e_asinl.c
e_atan2l.c
e_atanhl.c
e_coshl.c
e_exp10l.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
e_expl.c math: Fix up THREEp96 constant in expf128 [BZ #32411] 2025-04-09 18:24:11 +02:00
e_fmodl.c
e_gammal_r.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
e_hypotl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
e_ilogbl.c
e_j0l.c
e_j1l.c
e_jnl.c
e_lgammal_r.c
e_log2l.c
e_log10l.c
e_logl.c
e_powl.c
e_rem_pio2l.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
e_remainderl.c sysdeps/ieee754: Fix remainder sign of zero for FE_DOWNWARD (BZ #32711) 2025-02-26 17:17:25 -03:00
e_sinhl.c
float128-abi.h
gamma_productl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ieee754.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
k_cosl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
k_sincosl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
k_sinl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
k_tanl.c
ldbl2mpn.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lgamma_negl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
lgamma_productl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
math-nan-payload-ldouble.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
math_ldbl.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
mpn2ldbl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
printf_fphex.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
printf_fphex_macros.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_asinhl.c
s_atanl.c
s_cbrtl.c
s_ceill.c
s_copysignl.c
s_cosl.c
s_daddl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_ddivl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_dfmal.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_dmull.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_dsqrtl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_dsubl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_erfcl.c math: Split s_erfF in erff and erfc 2024-11-22 10:52:26 -03:00
s_erfl.c
s_expm1l.c
s_f64xaddf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_f64xdivf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_f64xfmaf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_f64xmulf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_f64xsqrtf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_f64xsubf128.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fabsl.c
s_faddl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fdivl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_ffmal.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_finitel.c
s_floorl.c
s_fma.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fmal.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fmull.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fpclassifyl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_frexpl.c
s_fromfpl.c
s_fromfpl_main.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fromfpxl.c
s_fsqrtl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_fsubl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_getpayloadl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_isinfl.c
s_isnanl.c
s_issignalingl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_llrintl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_llroundl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_log1pl.c
s_logbl.c
s_lrintl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_lroundl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_modfl.c
s_nearbyintl.c
s_nextafterl.c
s_nexttoward.c
s_nexttowardf.c
s_nextupl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_remquol.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_rintl.c
s_roundevenl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_roundl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_scalblnl.c
s_scalbnl.c
s_setpayloadl.c
s_setpayloadl_main.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_setpayloadsigl.c
s_signbitl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_sincosl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_sinl.c
s_tanhl.c
s_tanl.c
s_totalorderl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_totalordermagl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_truncl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
s_ufromfpl.c
s_ufromfpxl.c
strtold_l.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
t_expl.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
t_sincosl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-scanf-format-ldouble-a.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
tst-scanf-format-ldouble-aa.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
tst-scanf-format-ldouble-e.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
tst-scanf-format-ldouble-ee.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
tst-scanf-format-ldouble-f.input stdio-common: Add scanf long double data for IEEE 754 binary128 format 2025-03-25 09:40:20 +00:00
tst-scanf-format-ldouble-ff.input stdio-common: Add scanf long double data for IEEE 754 binary128 format 2025-03-25 09:40:20 +00:00
tst-scanf-format-ldouble-g.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
tst-scanf-format-ldouble-gg.input stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701] 2025-03-28 12:35:53 +00:00
x2y2m1l.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00