summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 15:58:23 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 15:58:23 +0000
commit25ead03a3712d57df2208fe82f3d316eb8faeaf6 (patch)
treeeb6ebccbeffba879a7cf9cbaa29daeeb73d8e049 /sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
parentbf9f3c5bced2d3a5fb782b5a7de1008d8ca1425c (diff)
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
Merge commit 'refs/top-bases/t/faccessat' into t/faccessat
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/e_hypotl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_hypotl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index c68dac03b0..842f77b7ed 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double
__ieee754_hypotl(long double x, long double y)
@@ -67,6 +68,8 @@ __ieee754_hypotl(long double x, long double y)
if(ha > 0x5f30000000000000LL) { /* a>2**500 */
if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
if(ha == 0x7ff0000000000000LL)
w = a;
if(hb == 0x7ff0000000000000LL)
@@ -105,7 +108,7 @@ __ieee754_hypotl(long double x, long double y)
= a1*(a1+a2) + a2*a + b*b
= a1*a1 + a1*a2 + a2*a + b*b
= a1*a1 + a2*(a+a1) + b*b */
- w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
+ w = sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
} else {
a = a+a;
ldbl_unpack (b, &hi, &lo);
@@ -122,7 +125,7 @@ __ieee754_hypotl(long double x, long double y)
= w*w + a1*b + a2*b
= w*w + a1*(b1+b2) + a2*b
= w*w + a1*b1 + a1*b2 + a2*b */
- w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
+ w = sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
}
if(k!=0)
{