]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/ieee754/dbl-64/doasin.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / ieee754 / dbl-64 / doasin.c
CommitLineData
e4d82761
UD
1/*
2 * IBM Accurate Mathematical Library
aeb25823 3 * written by International Business Machines Corp.
d614a753 4 * Copyright (C) 2001-2020 Free Software Foundation, Inc.
e4d82761
UD
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
cc7375ce 8 * the Free Software Foundation; either version 2.1 of the License, or
e4d82761 9 * (at your option) any later version.
ca58f1db 10 *
e4d82761
UD
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c6c6dd48 14 * GNU Lesser General Public License for more details.
e4d82761
UD
15 *
16 * You should have received a copy of the GNU Lesser General Public License
5a82c748 17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
e4d82761
UD
18 */
19/**********************************************************************/
20/* MODULE_NAME: doasin.c */
21/* */
ca58f1db 22/* FUNCTION: doasin */
e4d82761
UD
23/* */
24/* FILES NEEDED:endian.h mydefs.h dla.h doasin.h */
25/* mpa.c */
26/* */
27/* Compute arcsin(x,dx,v) of double-length number (x+dx) the result */
28/* stored in v where v= v[0]+v[1] =arcsin(x+dx) */
29/**********************************************************************/
30
31#include "endian.h"
32#include "mydefs.h"
c8b3296b 33#include <dla.h>
1ed0291c 34#include <math_private.h>
e4d82761 35
31d3cc00
UD
36#ifndef SECTION
37# define SECTION
38#endif
39
e4d82761
UD
40/********************************************************************/
41/* Compute arcsin(x,dx,v) of double-length number (x+dx) the result */
42/* stored in v where v= v[0]+v[1] =arcsin(x+dx) */
43/********************************************************************/
31d3cc00
UD
44void
45SECTION
46__doasin(double x, double dx, double v[]) {
ca58f1db 47
e4d82761
UD
48#include "doasin.h"
49
ca58f1db 50 static const double
e4d82761
UD
51 d5 = 0.22372159090911789889975459505194491E-01,
52 d6 = 0.17352764422456822913014975683014622E-01,
53 d7 = 0.13964843843786693521653681033981614E-01,
54 d8 = 0.11551791438485242609036067259086589E-01,
55 d9 = 0.97622386568166960207425666787248914E-02,
56 d10 = 0.83638737193775788576092749009744976E-02,
57 d11 = 0.79470250400727425881446981833568758E-02;
ca58f1db 58
e4d82761 59 double xx,p,pp,u,uu,r,s;
a1a87169 60 double tc,tcc;
58985aa9 61#ifndef DLA_FMS
a1a87169
UD
62 double hx,tx,hy,ty,tp,tq;
63#endif
ca58f1db 64
e4d82761
UD
65
66/* Taylor series for arcsin for Double-Length numbers */
67 xx = x*x+2.0*x*dx;
68 p = ((((((d11*xx+d10)*xx+d9)*xx+d8)*xx+d7)*xx+d6)*xx+d5)*xx;
69 pp = 0;
70
71 MUL2(x,dx,x,dx,u,uu,tp,hx,tx,hy,ty,tq,tc,tcc);
72 ADD2(p,pp,c4.x,cc4.x,p,pp,r,s);
73 MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
74 ADD2(p,pp,c3.x,cc3.x,p,pp,r,s);
75 MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
76 ADD2(p,pp,c2.x,cc2.x,p,pp,r,s);
77 MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
78 ADD2(p,pp,c1.x,cc1.x,p,pp,r,s);
79 MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
80 MUL2(p,pp,x,dx,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
81 ADD2(p,pp,x,dx,p,pp,r,s);
82 v[0]=p;
83 v[1]=pp; /* arcsin(x+dx)=v[0]+v[1] */
84}