summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_asinh.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
commit4dd9e35bfd35d3138bc44169baba098005bad51e (patch)
treea4939c43a9c3fe00eb27f023e14acc5e1fe8808c /sysdeps/ieee754/dbl-64/s_asinh.c
parentbd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff)
parentf76453c31593957fec1a99b986bfa5506618b79c (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_asinh.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_asinh.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c
index 5500746848..ebe471015b 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>
@@ -36,12 +37,17 @@ __asinh (double x)
int32_t hx, ix;
GET_HIGH_WORD (hx, x);
ix = hx & 0x7fffffff;
- if (__builtin_expect (ix < 0x3e300000, 0)) /* |x|<2**-28 */
+ 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 */
}
- if (__builtin_expect (ix > 0x41b00000, 0)) /* |x| > 2**28 */
+ if (__glibc_unlikely (ix > 0x41b00000)) /* |x| > 2**28 */
{
if (ix >= 0x7ff00000)
return x + x; /* x is inf or NaN */