21 #ifndef RFFGEN_CMATH_SINE_HH
22 #define RFFGEN_CMATH_SINE_HH
25 #include "../Util/base.hh"
26 #include "../Util/chainer.hh"
42 using Chainer<Sin>::operator ();
48 explicit Sin(
double x=0)
61 double d0() const noexcept {
return sinx; }
65 double d1(
double dx=1.)
const {
return cosx*dx; }
68 template <
int = -1 ,
int = -1 >
69 double d2(
double dx=1.,
double dy=1.)
const {
return -sinx*dx*dy; }
72 template <
int = -1 ,
int = -1 ,
int = -1>
73 double d3(
double dx=1.,
double dy=1.,
double dz=1.)
const {
return -cosx*dx*dy*dz; }
83 template <class Function, class = std::enable_if_t<std::is_base_of<Base,Function>::value> >
84 auto sin(
const Function& f)
91 #endif // RFFGEN_CMATH_SINE_HH
double d2(double dx=1., double dy=1.) const
Second (directional) derivative.
Definition: sine.hh:69
double d3(double dx=1., double dy=1., double dz=1.) const
Third (directional) derivative.
Definition: sine.hh:73
double d0() const noexcept
Function value.
Definition: sine.hh:61
void update(double x)
Reset point of evaluation.
Definition: sine.hh:54
Base class for functions satisfying FunctionConcept. Required for enabling the operators in generate...
Definition: base.hh:27
double d1(double dx=1.) const
First (directional) derivative.
Definition: sine.hh:65
Sine function including first three derivatives (based on sin(double) in <cmath>).
Definition: sine.hh:40
Sin(double x=0)
Constructor.
Definition: sine.hh:48