comparison libquadmath/math/atanhq.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* s_atanhl.c -- __float128 version of s_atan.c. 1 /* s_atanhl.c -- long double version of s_atan.c.
2 * Conversion to __float128 by Ulrich Drepper, 2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com. 3 * Cygnus Support, drepper@cygnus.com.
4 */ 4 */
5 5
6 /* 6 /*
7 * ==================================================== 7 * ====================================================
20 * 2.For x>=0.5 20 * 2.For x>=0.5
21 * 1 2x x 21 * 1 2x x
22 * atanhl(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) 22 * atanhl(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
23 * 2 1 - x 1 - x 23 * 2 1 - x 1 - x
24 * 24 *
25 * For x<0.5 25 * For x<0.5
26 * atanhl(x) = 0.5*log1pl(2x+2x*x/(1-x)) 26 * atanhl(x) = 0.5*log1pq(2x+2x*x/(1-x))
27 * 27 *
28 * Special cases: 28 * Special cases:
29 * atanhl(x) is NaN if |x| > 1 with signal; 29 * atanhl(x) is NaN if |x| > 1 with signal;
30 * atanhl(NaN) is that NaN with no signal; 30 * atanhl(NaN) is that NaN with no signal;
31 * atanhl(+-1) is +-INF with signal. 31 * atanhl(+-1) is +-INF with signal.
32 * 32 *
33 */ 33 */
34 34
35 #include "quadmath-imp.h" 35 #include "quadmath-imp.h"
36 36
37 static const __float128 one = 1.0Q, huge = 1e4900Q; 37 static const __float128 one = 1, huge = 1e4900Q;
38 static const __float128 zero = 0.0Q; 38
39 static const __float128 zero = 0;
39 40
40 __float128 41 __float128
41 atanhq (__float128 x) 42 atanhq(__float128 x)
42 { 43 {
43 __float128 t; 44 __float128 t;
44 uint32_t jx, ix; 45 uint32_t jx, ix;
45 ieee854_float128 u; 46 ieee854_float128 u;
46 47