diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_erfl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/s_erfl.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c index f6fcf48cfa..7b761b0afa 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c @@ -106,6 +106,7 @@ #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> +#include <fix-int-fp-convert-zero.h> /* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */ @@ -146,7 +147,6 @@ deval (long double x, const long double *p, int n) static const long double tiny = 1e-300L, - half = 0.5L, one = 1.0L, two = 2.0L, /* 2/sqrt(pi) - 1 */ @@ -805,11 +805,7 @@ __erfl (long double x) if (x == 0) return x; long double ret = 0.0625 * (16.0 * x + (16.0 * efx) * x); - if (fabsl (ret) < LDBL_MIN) - { - long double force_underflow = ret * ret; - math_force_eval (force_underflow); - } + math_check_force_underflow (ret); return ret; } return x + efx * x; @@ -843,7 +839,10 @@ __erfcl (long double x) if (ix >= 0x7ff00000) { /* erfc(nan)=nan */ /* erfc(+-inf)=0,2 */ - return (long double) ((hx >> 31) << 1) + one / x; + long double ret = (long double) ((hx >> 31) << 1) + one / x; + if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0L) + return 0.0L; + return ret; } if (ix < 0x3fd00000) /* |x| <1/4 */ |