Mercurial > hg > CbC > CbC_gcc
comparison libquadmath/math/atanq.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_atanl.c | 1 /* s_atanl.c |
2 * | 2 * |
3 * Inverse circular tangent for 128-bit __float128 precision | 3 * Inverse circular tangent for 128-bit long double precision |
4 * (arctangent) | 4 * (arctangent) |
5 * | 5 * |
6 * | 6 * |
7 * | 7 * |
8 * SYNOPSIS: | 8 * SYNOPSIS: |
9 * | 9 * |
10 * __float128 x, y, atanl(); | 10 * long double x, y, atanq(); |
11 * | 11 * |
12 * y = atanl( x ); | 12 * y = atanq( x ); |
13 * | 13 * |
14 * | 14 * |
15 * | 15 * |
16 * DESCRIPTION: | 16 * DESCRIPTION: |
17 * | 17 * |
53 but WITHOUT ANY WARRANTY; without even the implied warranty of | 53 but WITHOUT ANY WARRANTY; without even the implied warranty of |
54 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 54 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
55 Lesser General Public License for more details. | 55 Lesser General Public License for more details. |
56 | 56 |
57 You should have received a copy of the GNU Lesser General Public | 57 You should have received a copy of the GNU Lesser General Public |
58 License along with this library; if not, write to the Free Software | 58 License along with this library; if not, see |
59 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | 59 <http://www.gnu.org/licenses/>. */ |
60 | |
61 | 60 |
62 #include "quadmath-imp.h" | 61 #include "quadmath-imp.h" |
63 | 62 |
64 /* arctan(k/8), k = 0, ..., 82 */ | 63 /* arctan(k/8), k = 0, ..., 82 */ |
65 static const __float128 atantbl[84] = { | 64 static const __float128 atantbl[84] = { |
226 else | 225 else |
227 { | 226 { |
228 /* Index of nearest table element. | 227 /* Index of nearest table element. |
229 Roundoff to integer is asymmetrical to avoid cancellation when t < 0 | 228 Roundoff to integer is asymmetrical to avoid cancellation when t < 0 |
230 (cf. fdlibm). */ | 229 (cf. fdlibm). */ |
231 k = 8.0Q * x + 0.25Q; | 230 k = 8.0 * x + 0.25; |
232 u = 0.125Q * k; | 231 u = 0.125Q * k; |
233 /* Small arctan argument. */ | 232 /* Small arctan argument. */ |
234 t = (x - u) / (1.0 + x * u); | 233 t = (x - u) / (1.0 + x * u); |
235 } | 234 } |
236 | 235 |