glibc/sysdeps/ieee754/dbl-64
Joseph Myers 739babd775 Fix fma spurious underflows (bug 18824).
Various fma implementations have logic that, when computing fma (x, y,
z) where z is large (so care needs taking to avoid internal overflow)
but x * y is small, scale x * y up instead of down to avoid internal
underflows resulting from scaling down.  (In these cases, x * y is
small enough that only its sign actually matters rather than the exact
value.)

The threshold for scaling up instead of down was correct for "if the
unscaled values were multiplied, the low part of the multiplication
could underflow", and the scaling was sufficient to ensure that the
low part of the multiplication did not underflow (given that cases of
very small x * y - less than half the least subnormal - were
previously dealt with).  However, the choice in the functions wasn't
between scaling up or no scaling, but between scaling up and scaling
down (scaling down actually being needed when x * y isn't so small
compared to z and so the exact value does matter).  Thus a larger
threshold is needed to ensure that scaling down doesn't produce values
the multiplication of whose low parts underflows.  This patch
increases the thresholds accordingly.

Tested for x86_64, x86 and mips64 (with the MIPS version of s_fmal.c
removed so that the ldbl-128 version gets tested instead of the
soft-fp one).

	[BZ #18824]
	* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Increase threshold for
	scaling x * y up instead of down.
	* sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Likewise.
	* sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Likewise.
	* math/auto-libm-test-in: Add more tests of fma.
	* math/auto-libm-test-out: Regenerated.
2015-08-14 17:15:06 +00:00
..
wordsize-64 Fix expm1 missing underflows (bug 16353). 2015-06-22 21:06:19 +00:00
asincos.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
atnat2.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
atnat.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
branred.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
branred.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dbl2mpn.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dla.h Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
doasin.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
doasin.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dosincos.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dosincos.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
e_acos.c
e_acosh.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_asin.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
e_atan2.c Fix dbl-64 atan2 in non-default rounding modes (bug 18210, bug 18211). 2015-04-08 17:32:17 +00:00
e_atanh.c Fix atanhl missing underflows (bug 16352). 2015-05-15 22:07:57 +00:00
e_cosh.c Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061). 2014-06-23 20:20:10 +00:00
e_exp2.c Fix exp2, exp2f spurious underflows (bug 18219). 2015-06-23 14:35:18 +00:00
e_exp10.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_exp.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_fmod.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_gamma_r.c Improve tgamma accuracy (bug 18613). 2015-06-29 23:29:35 +00:00
e_hypot.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_ilogb.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_j0.c Avoid uninitialized warnings in Bessel functions. 2015-02-26 21:49:19 +00:00
e_j1.c Fix j1, jn missing underflows (bug 16559). 2015-06-29 16:52:16 +00:00
e_jn.c Fix j1, jn missing underflows (bug 16559). 2015-06-29 16:52:16 +00:00
e_lgamma_r.c Fix lgamma implementations for -Wuninitialized. 2015-05-21 23:44:33 +00:00
e_log2.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_log10.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_log.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
e_pow.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_rem_pio2.c Format floating routines. 2013-10-17 16:03:24 +02:00
e_remainder.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
e_sinh.c Fix sinh missing underflows (bug 16519). 2015-08-06 23:01:09 +00:00
e_sqrt.c Fix libm fegetround namespace (bug 17748). 2015-01-02 20:44:42 +00:00
gamma_product.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
gamma_productf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
halfulp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
k_cos.c
k_rem_pio2.c Format floating routines. 2013-10-17 16:03:24 +02:00
k_sin.c
k_tan.c Replace sysdeps/ieee754/dbl-64/k_tan.c with empty file 2012-02-26 16:10:46 +01:00
Makefile powerpc: Fix incorrect results for pow when using FMA 2015-03-10 09:38:54 -04:00
MathLib.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpa-arch.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpa.c Fix sysdeps/ieee754/dbl-64/mpa.c for -Wuninitialized. 2015-05-21 23:05:45 +00:00
mpa.h Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
mpatan2.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpatan.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
mpatan.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpexp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mplog.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpn2dbl.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpsqrt.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mpsqrt.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mptan.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mydefs.h Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
powtwo.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
root.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_asinh.c Fix asinh missing underflows (bug 16350). 2015-06-18 23:27:41 +00:00
s_atan.c Fix dbl-64 atan in non-default rounding modes (bug 18197). 2015-04-08 17:14:12 +00:00
s_cbrt.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_ceil.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_copysign.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_cos.c
s_erf.c Fix erf underflow handling near 0 (bug 16516). 2014-05-14 12:34:03 +00:00
s_expm1.c Fix expm1 missing underflows (bug 16353). 2015-06-22 21:06:19 +00:00
s_fabs.c 2015-05-28 Wilco Dijkstra <wdijkstr@arm.com> 2015-05-28 11:42:55 +01:00
s_finite.c PowerPC: multiarch finite/finitef for PowerPC32 2013-12-06 05:47:03 -06:00
s_floor.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_fma.c Fix fma spurious underflows (bug 18824). 2015-08-14 17:15:06 +00:00
s_fmaf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_fpclassify.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_frexp.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isinf_ns.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isinf.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_isnan.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_issignaling.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_llrint.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_llround.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_log1p.c Fix log1p missing underflows (bug 16339). 2015-05-14 23:38:07 +00:00
s_logb.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_lrint.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_lround.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_modf.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_nearbyint.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_nexttoward.c
s_remquo.c Fix sign of remquo zero remainder in round-downward mode (bug 17987). 2015-02-17 00:41:50 +00:00
s_rint.c Format floating routines. 2013-10-17 16:03:24 +02:00
s_round.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_scalbln.c [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
s_scalbn.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s_signbit.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_sin.c Fix sin, sincos missing underflows (bug 16526, bug 16538). 2015-06-23 22:24:20 +00:00
s_sincos.c Fix sincos errno setting (bug 15467). 2015-02-11 23:17:25 +00:00
s_tan.c Fix tan missing underflows (bug 16517). 2015-08-07 23:10:35 +00:00
s_tanh.c Fix tanh missing underflows (bug 16520). 2015-08-13 16:40:39 +00:00
s_trunc.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sincos32.c Remove various ABS macros and replace uses with fabs (or in one case abs) 2015-05-15 11:04:40 +00:00
sincos32.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sincostab.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
slowexp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
slowpow.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
t_exp2.h
t_exp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
uasncs.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
uatan.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
uexp.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
uexp.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
ulog.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
ulog.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
upow.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
upow.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
urem.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
uroot.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
usncs.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
utan.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
utan.tbl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
w_exp.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
x2y2m1.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
x2y2m1f.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00