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

◆ bessel_y

kyosu::bessel_y = eve::functor<bessel_y_t>
inlineconstexpr

Computes the spherical or cylindrical Bessel functions of the second kind, extended to the complex plane and cayley_dickson algebras.

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<eve;scalar_value N, kyosu::concepts::cayley_dickson T> constexpr auto bessel_y(N n, T z) noexcept; //1
template<eve;scalar_value N, kyosu::concepts::real T> constexpr T bessel_y(N n, T z) noexcept; //1
template<eve;scalar_value N, kyosu::concepts::complex T, size_t S> constexpr auto bessel_y(N n, T z, std::span<Z, S> cys) noexcept; //2
template<eve;scalar_value N, kyosu::concepts::real T, size_t S> constexpr T bessel_y(N n, T z, std::span<Z, S> cys) noexcept; //2
template<eve;scalar_value N, kyosu::concepts::cayley_dickson T> constexpr auto bessel_y[spherical](N n, T z) noexcept; //3
template<eve;scalar_value N, kyosu::concepts::real T> constexpr T bessel_y[spherical](N n, T z) noexcept; //3
template<eve;scalar_value N, kyosu::concepts::complex T, size_t S> constexpr auto bessel_y[spherical](N n, T z, std::span<Z, S> sys) noexcept; //4
template<eve;scalar_value N, kyosu::concepts::real T, size_t S> constexpr T bessel_y[spherical](N n, T z, std::span<Z, S> sys) noexcept; //4
}
constexpr auto bessel_y
Computes the spherical or cylindrical Bessel functions of the second kind, extended to the complex pl...
Definition: bessel_y.hpp:138
Main KYOSU namespace.
Definition: cinf.hpp:13

Parameters

  • n: scalar order (integral or floating)
  • z: Value to process.
  • sys, cys : std::span of T

Return value

  1. returns \(Y_n\)(z) (cylindrical).
  2. Same as 1, but cys is filled by the lesser orders.
  3. returns \(y_n\)(z) (spherical).
  4. Same as 3, but sys is filled by the lesser orders.
Note
  • Let \( i = \lfloor |n| \rfloor \) and \( j=|n|-i\). If \(n\) is positive the lesser order are \((\pm j, \pm(j+1), \dots, \pm(j+i)) \) with \(+\) sign if \(n\) is positive and \(-\) sign if \(n\) is negative.
  • The span parameters are filled according the minimum of their allocated size and \(i\).
  • cylindical option can be used and its result is identical to the regular call (no option).

External references

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
int main()
{
std::cout<< std::setprecision(16) << std::endl;
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)> ys(nb);
kyosu::bessel_y(v, z, std::span(ys));
auto inc = eve::sign(v);
auto v0 = eve::frac(v);
for(int n=0; n < nb; ++n)
{
std::cout << "ys[" << n << "] = " << ys[n] << std::endl;
std::cout << "bessel_y[cylindrical](v0, z) = " << kyosu::bessel_y(v0, z) << std::endl;
v0 += inc;
}
return 0;
}
constexpr auto inc
Increments the argument.
Definition: inc.hpp:64
constexpr auto complex
Constructs a kyosu::complex_t instance.
Definition: to_complex.hpp:75