27 #ifndef math_func_jinc_hpp
28 #define math_func_jinc_hpp
34 #include "precision.hpp"
66 T
const taylor_0_bound = std::numeric_limits<T>::epsilon();
67 T
const taylor_2_bound = root_epsilon<T>();
69 if( std::fabs(x) > taylor_2_bound)
71 return bessel_j<int, T>(1,x)/(x);
76 T result =
static_cast<T
>(0.5);
77 if (std::fabs(x) >= taylor_0_bound)
82 result -= x2/
static_cast<T
>(16);
91 float jinc<float>(
const float & x);
94 double jinc<double>(
const double & x);
97 long double jinc<long double>(
const long double & x);
101 __float128 jinc<__float128>(
const __float128 & x);
119 template<
typename T1,
typename T2>
124 if(v == 1)
return jinc(x);
126 T2
const taylor_2_bound = root_epsilon<T2>();
128 if( std::fabs(x) > taylor_2_bound )
130 return bessel_j<T1, T2>(v,x)/(x);
134 return static_cast<T2
>(0);
139 float jincN<float, float>(
const float & v,
144 float jincN<int, float>(
const int & v,
149 double jincN<double, double>(
const double & v,
154 double jincN<int, double>(
const int & v,
160 long double jincN<long double, long double>(
const long double & v,
161 const long double & x
165 long double jincN<int, long double>(
const int & v,
166 const long double & x
172 __float128 jincN<__float128, __float128>(
const __float128 & v,
176 __float128 jincN<int, __float128>(
const int & v,
Declares and defines Bessel functions of the first kind.
T2 jincN(const T1 &v, const T2 &x)
The JincN function.
T jinc(const T &x)
The Jinc function.