ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
df1b2f26.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
12 #include <df1b2fun.h>
13 
19 {
21  df1b2variable z;
22 
23  double x=value(xx);
24 
25  double f=asin(x);
26 
27  double t1=1.0/(1-x*x);
28  double dfx = sqrt(t1);
29 
30  double t2 = t1*dfx;
31  double d2f = t2 *x;
32 
33  double d3f = t2 + 3.0* d2f*t1*x;
34 
35  double * xd=xx.get_u_dot();
36  double * zd=z.get_u_dot();
37  *z.get_u()=f;
38  for (unsigned int i=0;i<df1b2variable::nvar;i++)
39  {
40  *zd++ =dfx * *xd++;
41  }
43  f1b2gradlist->write_pass1(&xx,&z,dfx,d2f,d3f);
44 
45  return z;
46 }
df1b2_gradlist * f1b2gradlist
Definition: df1b2glo.cpp:49
double * get_u() const
Definition: df1b2fun.h:228
#define x
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Definition: fvar.hpp:140
Description not yet available.
Definition: df1b2fun.h:266
double * get_u_dot() const
Definition: df1b2fun.h:229
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2c.cpp:11
static int no_derivatives
Definition: df1b2fun.h:759
int write_pass1(const df1b2variable *px, const df1b2variable *py, df1b2variable *pz, df1b2function2 *pf)
Description not yet available.
Definition: df1b2f12.cpp:17
static unsigned int nvar
Definition: df1b2fun.h:290
Description not yet available.
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
dvector asin(const dvector &vec)
Returns dvector with principal value of the arc sine of vec, expressed in radians.
Definition: dvect6.cpp:229