3 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4 long double asinhl(long double x)
8 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
9 /* asinh(x) = sign(x)*log(|x|+sqrt(x*x+1)) ~= x - x^3/6 + o(x^5) */
10 long double asinhl(long double x)
14 struct{uint64_t m; uint16_t se; uint16_t pad;} i;
16 unsigned e = u.i.se & 0x7fff;
17 unsigned s = u.i.se >> 15;
23 if (e >= 0x3fff + 32) {
24 /* |x| >= 0x1p32 or inf or nan */
25 x = logl(x) + 0.693147180559945309417232121458176568L;
26 } else if (e >= 0x3fff + 1) {
28 x = logl(2*x + 1/(sqrtl(x*x+1)+x));
29 } else if (e >= 0x3fff - 32) {
31 x = log1pl(x + x*x/(sqrtl(x*x+1)+1));
33 /* |x| < 0x1p-32, raise inexact if x!=0 */
34 FORCE_EVAL(x + 0x1p120f);