Mercurial > hg > CbC > CbC_gcc
comparison libquadmath/math/atanhq.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 561a7518be6b |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
12 * software is freely granted, provided that this notice | 12 * software is freely granted, provided that this notice |
13 * is preserved. | 13 * is preserved. |
14 * ==================================================== | 14 * ==================================================== |
15 */ | 15 */ |
16 | 16 |
17 /* __ieee754_atanhl(x) | 17 /* atanhq(x) |
18 * Method : | 18 * Method : |
19 * 1.Reduced x to positive by atanh(-x) = -atanh(x) | 19 * 1.Reduced x to positive by atanh(-x) = -atanh(x) |
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 * --------) |
53 if (u.value == one) | 53 if (u.value == one) |
54 return x/zero; | 54 return x/zero; |
55 else | 55 else |
56 return (x-x)/(x-x); | 56 return (x-x)/(x-x); |
57 } | 57 } |
58 if(ix<0x3fc60000 && (huge+x)>zero) return x; /* x < 2^-57 */ | 58 if(ix<0x3fc60000 && (huge+x)>zero) /* x < 2^-57 */ |
59 { | |
60 math_check_force_underflow (x); | |
61 return x; | |
62 } | |
59 | 63 |
60 if(ix<0x3ffe0000) { /* x < 0.5 */ | 64 if(ix<0x3ffe0000) { /* x < 0.5 */ |
61 t = u.value+u.value; | 65 t = u.value+u.value; |
62 t = 0.5*log1pq(t+t*u.value/(one-u.value)); | 66 t = 0.5*log1pq(t+t*u.value/(one-u.value)); |
63 } else | 67 } else |