ADMB Documentation  11.1.1913
 All Classes Files Functions Variables Typedefs Friends Defines
df1b2f26.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: df1b2f26.cpp 1110 2013-07-12 01:11:28Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00012 #include <df1b2fun.h>
00013 
00018 df1b2variable asin(const df1b2variable& _xx)
00019 {
00020   ADUNCONST(df1b2variable,xx)
00021   df1b2variable z;
00022 
00023   double x=value(xx);
00024 
00025   double f=asin(x);
00026 
00027   double t1=1.0/(1-x*x);
00028   double dfx = sqrt(t1);
00029 
00030   double t2  = t1*dfx;
00031   double d2f = t2 *x;
00032 
00033   double d3f = t2 + 3.0* d2f*t1*x;
00034 
00035   double * xd=xx.get_u_dot();
00036   double * zd=z.get_u_dot();
00037   *z.get_u()=f;
00038   for (int i=0;i<df1b2variable::nvar;i++)
00039   {
00040     *zd++ =dfx * *xd++;
00041   }
00042   if (!df1b2_gradlist::no_derivatives)
00043     f1b2gradlist->write_pass1(&xx,&z,dfx,d2f,d3f);
00044 
00045   return z;
00046 }