Back to index

glibc  2.9
doasin.c
Go to the documentation of this file.
00001 /*
00002  * IBM Accurate Mathematical Library
00003  * written by International Business Machines Corp.
00004  * Copyright (C) 2001 Free Software Foundation
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2.1 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 /**********************************************************************/
00021 /* MODULE_NAME: doasin.c                                              */
00022 /*                                                                    */
00023 /* FUNCTION: doasin                                                   */
00024 /*                                                                    */
00025 /* FILES NEEDED:endian.h mydefs.h dla.h doasin.h                      */
00026 /*              mpa.c                                                 */
00027 /*                                                                    */
00028 /* Compute arcsin(x,dx,v) of double-length number (x+dx) the result   */
00029 /* stored in v where v= v[0]+v[1] =arcsin(x+dx)                       */
00030 /**********************************************************************/
00031 
00032 #include "endian.h"
00033 #include "mydefs.h"
00034 #include "dla.h"
00035 #include "math_private.h"
00036 
00037 /********************************************************************/
00038 /* Compute arcsin(x,dx,v) of double-length number (x+dx) the result */
00039 /* stored in v where v= v[0]+v[1] =arcsin(x+dx)                     */
00040 /********************************************************************/
00041 void __doasin(double x, double dx, double v[]) {
00042 
00043 #include "doasin.h"
00044 
00045   static const double
00046     d5 =  0.22372159090911789889975459505194491E-01,
00047     d6 =  0.17352764422456822913014975683014622E-01,
00048     d7 =  0.13964843843786693521653681033981614E-01,
00049     d8 =  0.11551791438485242609036067259086589E-01,
00050     d9 =  0.97622386568166960207425666787248914E-02,
00051     d10 = 0.83638737193775788576092749009744976E-02,
00052     d11 = 0.79470250400727425881446981833568758E-02;
00053 
00054   double xx,p,pp,u,uu,r,s;
00055   double hx,tx,hy,ty,tp,tq,tc,tcc;
00056 
00057 
00058 /* Taylor series for arcsin for Double-Length numbers         */
00059   xx = x*x+2.0*x*dx;
00060   p = ((((((d11*xx+d10)*xx+d9)*xx+d8)*xx+d7)*xx+d6)*xx+d5)*xx;
00061   pp = 0;
00062 
00063   MUL2(x,dx,x,dx,u,uu,tp,hx,tx,hy,ty,tq,tc,tcc);
00064   ADD2(p,pp,c4.x,cc4.x,p,pp,r,s);
00065   MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
00066   ADD2(p,pp,c3.x,cc3.x,p,pp,r,s);
00067   MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
00068   ADD2(p,pp,c2.x,cc2.x,p,pp,r,s);
00069   MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
00070   ADD2(p,pp,c1.x,cc1.x,p,pp,r,s);
00071   MUL2(p,pp,u,uu,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
00072   MUL2(p,pp,x,dx,p,pp,tp,hx,tx,hy,ty,tq,tc,tcc);
00073   ADD2(p,pp,x,dx,p,pp,r,s);
00074   v[0]=p;
00075   v[1]=pp; /* arcsin(x+dx)=v[0]+v[1] */
00076 }