Computes the spherical Bessel functions of the first kind, \( j_{n}(x)= \sqrt{\frac\pi{2x}}J_{n+1/2}(x)\).
It is the solution of \( x^{2}y''+2xy'+(x^2-n(n+1))y=0\) for which \( y(0) = 0\) if \(n \ne 0\) else \(1\).
{
template< eve::integral_real_value N, eve::floating_real_value T >
}
constexpr callable_sph_bessel_jn_ sph_bessel_jn
Computes the spherical Bessel functions of the first kind, .
Definition: sph_bessel_jn.hpp:56
Definition: all_of.hpp:22
The value of \( \displaystyle j_{n}(x)=
(-x)^n\left(\frac1x\frac{d}{dx}\right)^n \frac{\sin x}x\) is returned.
#include <eve/module/bessel.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft x = {0.5, 1.5, 0.1, 1.0, 19.0, 25.0, 21.5, 10000.0};
wide_ft n = {0, 1, 15, 2, 25, 26, 3, 12};
std::cout << "---- simd" << '\n'
<< "<- n = " << n << '\n'
<< "<- x = " << x << '\n'
;
double xd = 1.0;
std::cout << "---- scalar" << '\n'
<< "<- xd = " << xd << '\n'
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65