Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00011 #include <df1b2fun.h>
00012
00017 df1b2variable sin(const df1b2variable& _xx)
00018 {
00019 ADUNCONST(df1b2variable,xx)
00020 df1b2variable z;
00021 double x=value(_xx);
00022 double f=sin(x);
00023 double dfx=cos(x);
00024 double d2f=-f;
00025 double d3f=-dfx;
00026 double * xd=xx.get_u_dot();
00027 double * zd=z.get_u_dot();
00028 *z.get_u()=f;
00029 for (unsigned int i=0;i<df1b2variable::nvar;i++)
00030 {
00031 *zd++ =dfx * *xd++;
00032 }
00033 if (!df1b2_gradlist::no_derivatives)
00034 f1b2gradlist->write_pass1(&xx,&z,dfx,d2f,d3f);
00035
00036 return z;
00037 }
00038
00043 df1b2variable cos(const df1b2variable& _xx)
00044 {
00045 ADUNCONST(df1b2variable,xx)
00046 df1b2variable z;
00047 double x=value(_xx);
00048 double f=cos(x);
00049 double dfx=-sin(x);
00050 double d2f=-f;
00051 double d3f=-dfx;
00052 double * xd=xx.get_u_dot();
00053 double * zd=z.get_u_dot();
00054 *z.get_u()=f;
00055 for (unsigned int i=0;i<df1b2variable::nvar;i++)
00056 {
00057 *zd++ =dfx * *xd++;
00058 }
00059 if (!df1b2_gradlist::no_derivatives)
00060 f1b2gradlist->write_pass1(&xx,&z,dfx,d2f,d3f);
00061
00062 return z;
00063 }