E.V.E
v2022.09.01

◆ sph_bessel_j1

eve::sph_bessel_j1 = {}
inlineconstexpr

Computes the spherical Bessel function of the first kind, \( j_{1}(x)= \sqrt{\frac\pi{2x}}J_{3/2}(x) \).

It is the solution of \( x^{2}y''+2xy'+(x^2-2)y=0\) for which \( y(0) = 0\)

Defined in header

#include <eve/module/bessel.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_real_value T >
T sph_bessel_j1(T x) noexcept;
}
constexpr callable_sph_bessel_j1_ sph_bessel_j1
Computes the spherical Bessel function of the first kind, .
Definition: sph_bessel_j1.hpp:53
Definition: all_of.hpp:22

Parameters

Return value

The value of \( \displaystyle j_{1}(x)= \frac{\sin x}{x^2}- \frac{\cos x}{x}\) is returned.

Example

#include <eve/module/bessel.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.5, 1.5, 0.1, 1.0, 19.0, 25.0, 21.5, 10000.0};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> sph_bessel_j1(pf) = " << eve::sph_bessel_j1(pf) << '\n'
;
double xd = 1.0;
std::cout << "---- scalar" << '\n'
<< "<- xd = " << xd << '\n'
<< "-> sph_bessel_j1(xd) = " << eve::sph_bessel_j1(xd) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65