Mercurial > hg > CbC > CbC_gcc
comparison libquadmath/math/acosq.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 |
---|---|
29 | 29 |
30 You should have received a copy of the GNU Lesser General Public | 30 You should have received a copy of the GNU Lesser General Public |
31 License along with this library; if not, write to the Free Software | 31 License along with this library; if not, write to the Free Software |
32 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | 32 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
33 | 33 |
34 /* __ieee754_acosl(x) | 34 /* acosq(x) |
35 * Method : | 35 * Method : |
36 * acos(x) = pi/2 - asin(x) | 36 * acos(x) = pi/2 - asin(x) |
37 * acos(-x) = pi/2 + asin(x) | 37 * acos(-x) = pi/2 + asin(x) |
38 * For |x| <= 0.375 | 38 * For |x| <= 0.375 |
39 * acos(x) = pi/2 - asin(x) | 39 * acos(x) = pi/2 - asin(x) |
49 * | 49 * |
50 * Special cases: | 50 * Special cases: |
51 * if x is NaN, return x itself; | 51 * if x is NaN, return x itself; |
52 * if |x|>1, return NaN with invalid signal. | 52 * if |x|>1, return NaN with invalid signal. |
53 * | 53 * |
54 * Functions needed: __ieee754_sqrtl. | 54 * Functions needed: sqrtq. |
55 */ | 55 */ |
56 | 56 |
57 #include "quadmath-imp.h" | 57 #include "quadmath-imp.h" |
58 | 58 |
59 static const __float128 | 59 static const __float128 |
170 } | 170 } |
171 return (x - x) / (x - x); /* acos(|x| > 1) is NaN */ | 171 return (x - x) / (x - x); /* acos(|x| > 1) is NaN */ |
172 } | 172 } |
173 else if (ix < 0x3ffe0000) /* |x| < 0.5 */ | 173 else if (ix < 0x3ffe0000) /* |x| < 0.5 */ |
174 { | 174 { |
175 if (ix < 0x3fc60000) /* |x| < 2**-57 */ | 175 if (ix < 0x3f8e0000) /* |x| < 2**-113 */ |
176 return pio2_hi + pio2_lo; | 176 return pio2_hi + pio2_lo; |
177 if (ix < 0x3ffde000) /* |x| < .4375 */ | 177 if (ix < 0x3ffde000) /* |x| < .4375 */ |
178 { | 178 { |
179 /* Arcsine of x. */ | 179 /* Arcsine of x. */ |
180 z = x * x; | 180 z = x * x; |