diff options
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/dbl-64/s_asinh.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/flt-32/s_asinhf.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_asinhl.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/s_asinhl.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_asinhl.c | 6 |
5 files changed, 30 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c index a33758d..ebe4710 100644 --- a/sysdeps/ieee754/dbl-64/s_asinh.c +++ b/sysdeps/ieee754/dbl-64/s_asinh.c @@ -21,6 +21,7 @@ * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -38,6 +39,11 @@ __asinh (double x) ix = hx & 0x7fffffff; if (__glibc_unlikely (ix < 0x3e300000)) /* |x|<2**-28 */ { + if (fabs (x) < DBL_MIN) + { + double force_underflow = x * x; + math_force_eval (force_underflow); + } if (huge + x > one) return x; /* return x inexact except 0 */ } diff --git a/sysdeps/ieee754/flt-32/s_asinhf.c b/sysdeps/ieee754/flt-32/s_asinhf.c index b7fa2b4..697faa8 100644 --- a/sysdeps/ieee754/flt-32/s_asinhf.c +++ b/sysdeps/ieee754/flt-32/s_asinhf.c @@ -13,6 +13,7 @@ * ==================================================== */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -29,6 +30,11 @@ __asinhf(float x) GET_FLOAT_WORD(hx,x); ix = hx&0x7fffffff; if(__builtin_expect(ix< 0x38000000, 0)) { /* |x|<2**-14 */ + if (fabsf (x) < FLT_MIN) + { + float force_underflow = x * x; + math_force_eval (force_underflow); + } if(huge+x>one) return x; /* return x inexact except 0 */ } if(__builtin_expect(ix>0x47000000, 0)) { /* |x| > 2**14 */ diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c index e5a3636..8d5721a 100644 --- a/sysdeps/ieee754/ldbl-128/s_asinhl.c +++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c @@ -29,6 +29,7 @@ static char rcsid[] = "$NetBSD: $"; * := signl(x)*log1pl(|x| + x^2/(1 + sqrtl(1+x^2))) */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -51,6 +52,11 @@ __asinhl (long double x) return x + x; /* x is inf or NaN */ if (ix < 0x3fc70000) { /* |x| < 2^ -56 */ + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } if (huge + x > one) return x; /* return x inexact except 0 */ } diff --git a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c index b76e114..dda7f78 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c @@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $"; * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) */ +#include <float.h> #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> @@ -45,6 +46,11 @@ long double __asinhl(long double x) ix = hx&0x7fffffffffffffffLL; if(ix>=0x7ff0000000000000LL) return x+x; /* x is inf or NaN */ if(ix< 0x3c70000000000000LL) { /* |x|<2**-56 */ + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } if(huge+x>one) return x; /* return x inexact except 0 */ } if(ix>0x4370000000000000LL) { /* |x| > 2**56 */ diff --git a/sysdeps/ieee754/ldbl-96/s_asinhl.c b/sysdeps/ieee754/ldbl-96/s_asinhl.c index 5e679bd..75e47c7 100644 --- a/sysdeps/ieee754/ldbl-96/s_asinhl.c +++ b/sysdeps/ieee754/ldbl-96/s_asinhl.c @@ -29,6 +29,7 @@ static char rcsid[] = "$NetBSD: $"; * := signl(x)*log1pl(|x| + x^2/(1 + sqrtl(1+x^2))) */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -44,6 +45,11 @@ long double __asinhl(long double x) GET_LDOUBLE_EXP(hx,x); ix = hx&0x7fff; if(__builtin_expect(ix< 0x3fde, 0)) { /* |x|<2**-34 */ + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } if(huge+x>one) return x; /* return x inexact except 0 */ } if(__builtin_expect(ix>0x4020,0)) { /* |x| > 2**34 */ |