21 #ifndef RFFGEN_CMATH_ARCSINE_HH
22 #define RFFGEN_CMATH_ARCSINE_HH
25 #include "../Util/base.hh"
26 #include "../Util/chainer.hh"
27 #include "../Util/exceptions.hh"
43 using Chainer<ASin>::operator ();
56 #ifdef RFFGEN_ENABLE_EXCEPTIONS
60 firstDerivative = 1/::sqrt(1-(x*x));
61 firstDerivative3 = firstDerivative * firstDerivative * firstDerivative;
66 double d0() const noexcept
73 double d1(
double dx=1)
const
75 return firstDerivative * dx;
79 template <
int = -1 ,
int = -1 >
80 double d2(
double dx=1,
double dy=1)
const
82 return x_ * firstDerivative3 * dx * dy;
86 template <
int = -1 ,
int = -1 ,
int = -1>
87 double d3(
double dx=1,
double dy=1,
double dz=1)
const
89 return firstDerivative3 * ( 1 + ( 3 * x_ * x_ /(firstDerivative*firstDerivative) ) ) * dx * dy * dz;
93 double value = 0., firstDerivative = 1., firstDerivative3 = 1., x_ = 0.;
100 template <class Function, class = std::enable_if_t<std::is_base_of<Base,Function>::value> >
101 auto asin(
const Function& f)
108 #endif // RFFGEN_CMATH_ARCSINE_HH
double d1(double dx=1) const
First (directional) derivative.
Definition: arcsine.hh:73
Base class for functions satisfying FunctionConcept. Required for enabling the operators in generate...
Definition: base.hh:27
Sine function including first three derivatives (based on sin(double) in <cmath>).
Definition: arcsine.hh:41
ASin(double x=0.)
Constructor.
Definition: arcsine.hh:48
Exception for scalar function arguments that are outside the domain of the function.
Definition: exceptions.hh:40
double d2(double dx=1, double dy=1) const
Second (directional) derivative.
Definition: arcsine.hh:80
double d3(double dx=1, double dy=1, double dz=1) const
Third (directional) derivative.
Definition: arcsine.hh:87
void update(double x)
Reset point of evaluation.
Definition: arcsine.hh:54
double d0() const noexcept
Function value.
Definition: arcsine.hh:66