3 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4 long double hypotl(long double x
, long double y
)
8 #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
9 #if LDBL_MANT_DIG == 64
10 #define SPLIT (0x1p32L+1)
11 #elif LDBL_MANT_DIG == 113
12 #define SPLIT (0x1p57L+1)
15 static void sq(long double *hi
, long double *lo
, long double x
)
17 long double xh
, xl
, xc
;
22 *lo
= xh
*xh
- *hi
+ 2*xh
*xl
+ xl
*xl
;
25 long double hypotl(long double x
, long double y
)
27 union ldshape ux
= {x
}, uy
= {y
};
29 long double hx
, lx
, hy
, ly
, z
;
33 if (ux
.i
.se
< uy
.i
.se
) {
45 if (ex
== 0x7fff && isinf(y
))
47 if (ex
== 0x7fff || y
== 0)
49 if (ex
- ey
> LDBL_MANT_DIG
)
53 if (ex
> 0x3fff+8000) {
57 } else if (ey
< 0x3fff-8000) {
64 return z
*sqrtl(ly
+lx
+hy
+hx
);