diff options
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_atanh.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/flt-32/e_atanhf.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_atanhl.c | 11 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_atanhl.c | 11 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/e_atanhl.c | 6 |
5 files changed, 38 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c index b95399ddab..6b00b800f2 100644 --- a/sysdeps/ieee754/dbl-64/e_atanh.c +++ b/sysdeps/ieee754/dbl-64/e_atanh.c @@ -35,6 +35,7 @@ */ +#include <float.h> #include <inttypes.h> #include <math.h> #include <math_private.h> @@ -51,6 +52,11 @@ __ieee754_atanh (double x) if (__glibc_unlikely (xa < 0x1.0p-28)) { math_force_eval (huge + x); + if (fabs (x) < DBL_MIN) + { + double force_underflow = x * x; + math_force_eval (force_underflow); + } return x; } diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c index a6d8bd139f..bc74960e16 100644 --- a/sysdeps/ieee754/flt-32/e_atanhf.c +++ b/sysdeps/ieee754/flt-32/e_atanhf.c @@ -35,6 +35,7 @@ */ +#include <float.h> #include <inttypes.h> #include <math.h> #include <math_private.h> @@ -51,6 +52,11 @@ __ieee754_atanhf (float x) if (__glibc_unlikely (xa < 0x1.0p-28f)) { math_force_eval (huge + x); + if (fabsf (x) < FLT_MIN) + { + float force_underflow = x * x; + math_force_eval (force_underflow); + } return x; } diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c index c5cceb5224..a5a7ee0712 100644 --- a/sysdeps/ieee754/ldbl-128/e_atanhl.c +++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c @@ -32,6 +32,7 @@ * */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -57,7 +58,15 @@ __ieee754_atanhl(long double x) else return (x-x)/(x-x); } - if(ix<0x3fc60000 && (huge+x)>zero) return x; /* x < 2^-57 */ + if(ix<0x3fc60000 && (huge+x)>zero) /* x < 2^-57 */ + { + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } + return x; + } if(ix<0x3ffe0000) { /* x < 0.5 */ t = u.value+u.value; diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c index 5a989992f5..bcd1fce4ed 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c @@ -28,6 +28,7 @@ * */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -54,7 +55,15 @@ __ieee754_atanhl(long double x) if (t == one) return x/zero; } - if(ix<0x3c70000000000000LL&&(huge+x)>zero) return x; /* x<2**-56 */ + if(ix<0x3c70000000000000LL&&(huge+x)>zero) /* x<2**-56 */ + { + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } + return x; + } x = fabsl (x); if(ix<0x3fe0000000000000LL) { /* x < 0.5 */ t = x+x; diff --git a/sysdeps/ieee754/ldbl-96/e_atanhl.c b/sysdeps/ieee754/ldbl-96/e_atanhl.c index 305d50e309..9a957c9065 100644 --- a/sysdeps/ieee754/ldbl-96/e_atanhl.c +++ b/sysdeps/ieee754/ldbl-96/e_atanhl.c @@ -32,6 +32,7 @@ * */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -54,6 +55,11 @@ __ieee754_atanhl(long double x) return x/zero; if(ix<0x3fdf) { math_force_eval(huge+x); + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } return x; /* x<2**-32 */ } SET_LDOUBLE_EXP(x,ix); |