E.V.E
v2022.03.00

◆ cyl_bessel_j0

eve::cyl_bessel_j0 = {}
inlineconstexpr

Computes the Bessel function of the first kind, \( J_0(x)=\frac1{\pi }\int _{0}^{\pi}\cos(x\sin \tau) \,\mathrm {d} \tau \).

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

Defined in header

#include <eve/module/bessel.hpp>

Callable Signatures

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

Parameters

  • x : real floating argument.

Return value

The value of \( \displaystyle J_0(x)=\frac1{\pi }\int _{0}^{\pi}\cos(x\sin \tau ) \,\mathrm {d} \tau \) 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'
<< "-> cyl_bessel_j0(pf) = " << eve::cyl_bessel_j0(pf) << '\n'
;
double xd = -1.0;
std::cout << "---- scalar" << '\n'
<< "<- xd = " << xd << '\n'
<< "-> cyl_bessel_j0(xd) = " << eve::cyl_bessel_j0(xd) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65