21 #ifndef _tinyfadfunc_h_ 22 #define _tinyfadfunc_h_ 28 for (
int i=0; i< Num; i++)
36 if ( in.
val() <= 0)
error(
"TinyFad log (const TinyFad& in) : zero or negative value");
39 for (
int i=0; i< Num; i++)
40 tmp.
dx(i) = in.
dx(i) / in.
val();
47 if ( in.
val() < 0. )
error(
"TinyFad<Num,T> sqrt (const TinyFad& in) : negative value");
51 if ( in.
val() == T(0.) ){
52 for (
int i=0; i< Num; i++)
53 if ( in.
dx(i) != T(0.) ) test =
false;
56 error(
"TinyFad<Num,T> sqrt (const TinyFad& in) : null value");
59 for (
int i=0; i< Num; i++)
69 for (
int i=0; i< Num; i++)
80 for (
int i=0; i< Num; i++)
88 if ( in.
val() == 0)
error(
"TinyFad tan (const TinyFad& in) undiefined in 0.");
91 for (
int i=0; i< Num; i++){
93 tmp.
dx(i) = in.
dx(i) / cosinus / cosinus;
103 for (
int i=0; i< Num; i++){
112 if (un.
val() == 0)
error(
"TinyFad pow (const TinyFad& un, const TinyFad& deux), un = 0. ");
115 for (
int i=0; i< Num; i++){
127 for (
int i=0; i< Num; i++){
128 tmp.dx(i) = e*in.
dx(i)*
pow((
double)in.
val(), (double)e-1);
136 int sign = in.
val() > 0? 1:0;
TinyFad< Num, T > pow(const TinyFad< Num, T > &in, double e)
TinyFad< Num, T > exp(const TinyFad< Num, T > &in)
AutoPointerMutexArrayInit tmp
const T & dx(int i) const
TinyFad< Num, T > log(const TinyFad< Num, T > &in)
TinyFad< Num, T > cos(const TinyFad< Num, T > &in)
TinyFad< Num, T > sin(const TinyFad< Num, T > &in)
TinyFad< Num, T > tan(const TinyFad< Num, T > &in)
TinyFad< Num, T > abs(const TinyFad< Num, T > &in)
TinyFad< Num, T > sqrt(const TinyFad< Num, T > &in)