21 #ifndef RFFGEN_CMATH_TAN_HH
22 #define RFFGEN_CMATH_TAN_HH
25 #include "../Util/base.hh"
26 #include "../Util/chainer.hh"
42 using Chainer<Tan>::operator ();
53 firstDerivative = 1 + ( value * value );
57 double d0() const noexcept
64 double d1(
double dx = 1.)
const
66 return firstDerivative * dx;
70 template <
int = -1 ,
int = -1 >
71 double d2(
double dx = 1.,
double dy = 1.)
const
73 return ( 2 * value * firstDerivative ) * dx * dy;
77 template <
int = -1 ,
int = -1 ,
int = -1 >
78 double d3(
double dx = 1.,
double dy = 1.,
double dz = 1.)
const
80 return 2 * firstDerivative * ( 1 + ( 3 * value * value ) ) * dx * dy * dz;
84 double value = 0., firstDerivative = 1.;
91 template <class Function, class = std::enable_if_t<std::is_base_of<Base,Function>::value> >
92 auto tan(
const Function& f)
99 #endif // RFFGEN_CMATH_TAN_HH
double d3(double dx=1., double dy=1., double dz=1.) const
Third (directional) derivative.
Definition: tan.hh:78
Base class for functions satisfying FunctionConcept. Required for enabling the operators in generate...
Definition: base.hh:27
Tan(double x=0.)
Constructor.
Definition: tan.hh:47
double d2(double dx=1., double dy=1.) const
Second (directinal) derivative.
Definition: tan.hh:71
double d1(double dx=1.) const
First (directional) derivative.
Definition: tan.hh:64
void update(double x)
Reset point of evaluation.
Definition: tan.hh:50
double d0() const noexcept
Function value.
Definition: tan.hh:57
Tangent function including first three derivatives.
Definition: tan.hh:40