Statistics
| Revision:

root / branches / pthreads-737 / src / df1b2-separable / df1b2f26.cpp @ 765

History | View | Annotate | Download (816 Bytes)

1
/*
2
 * $Id: df1b2f26.cpp 542 2012-07-10 21:04:06Z johnoel $
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
6
 */
7
/**
8
 * \file
9
 * Description not yet available.
10
 */
11

    
12
#include <df1b2fun.h>
13

    
14
/**
15
 * Description not yet available.
16
 * \param
17
 */
18
df1b2variable asin(const df1b2variable& _xx)
19
{
20
  ADUNCONST(df1b2variable,xx)
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 (int i=0;i<df1b2variable::nvar;i++)
39
  {
40
    *zd++ =dfx * *xd++;
41
  }
42
  if (!df1b2_gradlist::no_derivatives)
43
    f1b2gradlist->write_pass1(&xx,&z,dfx,d2f,d3f);
44

    
45
  return z;
46
}