kyosu v0.1.0
Complex Without Complexes
 
Loading...
Searching...
No Matches

◆ cyl_bessel_j

kyosu::cyl_bessel_j = {}
inlineconstexpr

Computes the Bessel functions of the first kind, \( J_{\nu}(x)=\sum_{p=0}^{\infty}{\frac{(-1)^p}{p!\,\Gamma (p+\nu +1)}} {\left({x \over 2}\right)}^{2p+\nu }\) extended to the complex plane and cayley_dickson values.

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

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<eve::floating_ordered_value, kyosu::concepts::cayley_dickson T>
constexpr auto cyl_bessel_j(N nu, T z) noexcept;
template<eve::floating_ordered_value, eve::floating_ordered_value T>
constexpr T cyl_bessel_j(N n, T z) noexcept;
}
constexpr tags::callable_cyl_bessel_j cyl_bessel_j
Computes the Bessel functions of the first kind, extended to the complex plane and cayley_dickson v...
Definition: cyl_bessel_j.hpp:100
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • nu: order of the function.
  • z: Value to process.

Return value

  • returns \(J_\nu(z)\).

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = -(2+1/3.0);
int nb = int(eve::abs(v)+1);
std::cout << "z " << z << std::endl;
std::vector<decltype(z)> js(nb);
auto inc = eve::sign(v);
auto v0 = eve::frac(v);
for(int n=0; n < nb; ++n)
{
std::cout << "js[" << n << "] = " << js[n] << std::endl;
std::cout << "j(" << v0 << ", z) " << kyosu::cyl_bessel_j(v0, z) << std::endl;
v0 += inc;
}
return 0;
}
constexpr tags::callable_inc inc
Increments the argument.
Definition: inc.hpp:72
constexpr tags::callable_complex complex
Constructs a kyosu::complex.
Definition: to_complex.hpp:70