24 #define FAD_FUNC_MACRO(NAME,FCT,FCTSTD,GRD,FASTGRD) \ 25 template <class Expr> class NAME \ 28 typedef typename Expr::value_type value_type; \ 34 NAME (const Expr & expr) : expr_(expr) {;} \ 35 inline value_type val() const { return FCTSTD(expr_.val());} \ 36 inline value_type dx(int i) const {return GRD ; } \ 37 inline int size() const { return expr_.size();} \ 39 bool hasFastAccess() const { return expr_.hasFastAccess();} \ 40 value_type fastAccessDx(int i) const { return FASTGRD;} \ 43 template <class Expr> inline FadExpr< NAME< FadExpr<Expr> > > \ 44 FCT (const FadExpr<Expr>& expr) \ 46 typedef NAME< FadExpr<Expr> > expr_t; \ 47 return FadExpr< expr_t >( expr_t(expr) ); \ 50 template <class T> inline FadExpr< NAME< Fad<T> > > \ 51 FCT (const Fad<T>& x) \ 53 typedef NAME< Fad<T> > expr_t; \ 54 return FadExpr< expr_t >( expr_t(x) ); \ 60 -expr_.dx(i)*
std::sin( expr_.val() ),
61 -expr_.fastAccessDx(i)*
std::sin( expr_.val() ) )
70 expr_.
dx(i)*(1.+
std::tan(expr_.val())*
std::tan(expr_.val())),
75 -expr_.
dx(i)/
std::
sqrt(1.-expr_.val()*expr_.val()),
80 expr_.
dx(i)/
std::
sqrt(1.-expr_.val()*expr_.val()),
85 expr_.
dx(i)/(1.+expr_.val()*expr_.val()),
95 expr_.
dx(i)*
std::cosh(expr_.val()),
100 expr_.
dx(i)/(
std::cosh(expr_.val())*
std::cosh(expr_.val())),
105 expr_.
dx(i)/
std::
sqrt((expr_.val()-1.)/(expr_.val()+1.)),
110 expr_.
dx(i)/
std::
sqrt(1.+expr_.val()*expr_.val()),
115 expr_.
dx(i)/(1.-expr_.val()*expr_.val()),
120 expr_.
dx(i)/(2.*
std::sqrt(expr_.val())),
125 expr_.
dx(i)*
std::exp(expr_.val()),
130 expr_.
dx(i)/expr_.val(),
135 expr_.
dx(i)/(
std::log(value_type(10))*expr_.val()),
140 std::abs(expr_.
dx(i)),
144 #undef FAD_FUNC_MACRO expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ tanh
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
REAL val(STATE &number)
Returns value of the variable.
#define FAD_FUNC_MACRO(NAME, FCT, FCTSTD, GRD, FASTGRD)
expr_ expr_ expr_ expr_ acos
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ acosh
expr_ dx(i) *cos(expr_.val())
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ cosh
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
expr_ expr_ fastAccessDx(i) *cos(expr_.val())) FAD_FUNC_MACRO(TFadFuncTan
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ atanh
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ log
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sinh
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ atan
expr_ expr_ expr_ expr_ expr_ expr_ asin
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ log10
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ asinh
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.