summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/dbl-64/e_hypot.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/ieee754/dbl-64/e_hypot.c')
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_hypot.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/e_hypot.c b/libc/sysdeps/ieee754/dbl-64/e_hypot.c
index 9f4321efe..88242bc4f 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -89,7 +89,7 @@ __ieee754_hypot (double x, double y)
SET_HIGH_WORD (a, ha);
SET_HIGH_WORD (b, hb);
}
- if (__builtin_expect (hb < 0x20b00000, 0)) /* b < 2**-500 */
+ if (__builtin_expect (hb < 0x23d00000, 0)) /* b < 2**-450 */
{
if (hb <= 0x000fffff) /* subnormal b or 0 */
{
@@ -102,6 +102,17 @@ __ieee754_hypot (double x, double y)
b *= t1;
a *= t1;
k -= 1022;
+ GET_HIGH_WORD (ha, a);
+ GET_HIGH_WORD (hb, b);
+ if (hb > ha)
+ {
+ t1 = a;
+ a = b;
+ b = t1;
+ j = ha;
+ ha = hb;
+ hb = j;
+ }
}
else /* scale a and b by 2^600 */
{