1 /* asinhq.c -- __float128 version of s_asinh.c.
2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com.
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
14 * ====================================================
20 * asinhl(x) = signl(x) * logl [ |x| + sqrtl(x*x+1) ]
22 * asinhl(x) := x if 1+x*x=1,
23 * := signl(x)*(logl(x)+ln2)) for large |x|, else
24 * := signl(x)*logl(2|x|+1/(|x|+sqrtl(x*x+1))) if|x|>2, else
25 * := signl(x)*log1pl(|x| + x^2/(1 + sqrtl(1+x^2)))
28 #include "quadmath-imp.h"
30 static const __float128
32 ln2 = 6.931471805599453094172321214581765681e-1Q,
44 ix = sign & 0x7fffffff;
46 return x + x; /* x is inf or NaN */
50 return x; /* return x inexact except 0 */
55 w = logq (u.value) + ln2;
57 else if (ix >0x40000000)
58 { /* 2^ 54 > |x| > 2.0 */
60 w = logq (2.0 * t + one / (sqrtq (x * x + one) + t));
63 { /* 2.0 > |x| > 2 ^ -56 */
65 w = log1pq (u.value + t / (one + sqrtq (one + t)));
67 if (sign & 0x80000000)