37 const T
cone(1), chalf(0.5), alpha(2);
38 const T tanh_x =
std::tanh((x - chalf) * alpha);
39 const T dtanhx_dx =
cone - tanh_x * tanh_x;
41 dx = -chalf * alpha * dtanhx_dx;
42 d2x = alpha * alpha * tanh_x * dtanhx_dx;
43 return chalf * (
cone - tanh_x);
48 const T chalf(0.5),
cone(1), pihalf(M_PI * chalf), pipihalf(M_PI * M_PI * chalf);
53 dx = -chalf * pipihalf * scos *
s;
54 d2x = -pihalf * pipihalf * (ccos * pihalf *
s *
s + scos * c);
55 return chalf * (
cone + ccos);
65 throw std::runtime_error(
"Unknown smooth function!");
helper functions for EinsplineSetBuilder
constexpr std::complex< float > cone
MakeReturn< UnaryNode< FnHypTan, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t tanh(const Vector< T1, C1 > &l)
T smoothing(smoothing_functions func_id, T x, T &dx, T &d2x)
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper