comparison libquadmath/math/asinq.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
8 * is preserved. 8 * is preserved.
9 * ==================================================== 9 * ====================================================
10 */ 10 */
11 11
12 /* 12 /*
13 __float128 expansions are 13 Long double expansions are
14 Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> 14 Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
15 and are incorporated herein by permission of the author. The author 15 and are incorporated herein by permission of the author. The author
16 reserves the right to distribute this material elsewhere under different 16 reserves the right to distribute this material elsewhere under different
17 copying permissions. These modifications are distributed here under the 17 copying permissions. These modifications are distributed here under the
18 following terms: 18 following terms:
19 19
20 This library is free software; you can redistribute it and/or 20 This library is free software; you can redistribute it and/or
21 modify it under the terms of the GNU Lesser General Public 21 modify it under the terms of the GNU Lesser General Public
22 License as published by the Free Software Foundation; either 22 License as published by the Free Software Foundation; either
26 but WITHOUT ANY WARRANTY; without even the implied warranty of 26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 Lesser General Public License for more details. 28 Lesser General Public License for more details.
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, see
32 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 32 <http://www.gnu.org/licenses/>. */
33 33
34 /* asinq(x) 34 /* __ieee754_asin(x)
35 * Method : 35 * Method :
36 * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ... 36 * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
37 * we approximate asin(x) on [0,0.5] by 37 * we approximate asin(x) on [0,0.5] by
38 * asin(x) = x + x*x^2*R(x^2) 38 * asin(x) = x + x*x^2*R(x^2)
39 * Between .5 and .625 the approximation is 39 * Between .5 and .625 the approximation is
56 * if x is NaN, return x itself; 56 * if x is NaN, return x itself;
57 * if |x|>1, return NaN with invalid signal. 57 * if |x|>1, return NaN with invalid signal.
58 * 58 *
59 */ 59 */
60 60
61
62 #include "quadmath-imp.h" 61 #include "quadmath-imp.h"
63 62
64 static const __float128 63 static const __float128
65 one = 1.0Q, 64 one = 1,
66 huge = 1.0e+4932Q, 65 huge = 1.0e+4932Q,
67 pio2_hi = 1.5707963267948966192313216916397514420986Q, 66 pio2_hi = 1.5707963267948966192313216916397514420986Q,
68 pio2_lo = 4.3359050650618905123985220130216759843812E-35Q, 67 pio2_lo = 4.3359050650618905123985220130216759843812E-35Q,
69 pio4_hi = 7.8539816339744830961566084581987569936977E-1Q, 68 pio4_hi = 7.8539816339744830961566084581987569936977E-1Q,
70 69
127 126
128 127
129 __float128 128 __float128
130 asinq (__float128 x) 129 asinq (__float128 x)
131 { 130 {
132 __float128 t = 0; 131 __float128 t, w, p, q, c, r, s;
133 __float128 w, p, q, c, r, s;
134 int32_t ix, sign, flag; 132 int32_t ix, sign, flag;
135 ieee854_float128 u; 133 ieee854_float128 u;
136 134
137 flag = 0; 135 flag = 0;
138 u.value = x; 136 u.value = x;