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

◆ sph_bessel_h2n

kyosu::sph_bessel_h2n = {}
inlineconstexpr

Computes the spherical Bessel/hankel functions of the third kind, \( h_n^{(2)}(z) = j_n(z)-iy_n(z)\).

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr auto sph_bessel_h2n(int n, T z) noexcept;
template<eve::floating_ordered_value T> constexpr auto sph_bessel_h2n(int n, T z) noexcept;
}
constexpr tags::callable_sph_bessel_h2n sph_bessel_h2n
Computes the spherical Bessel/hankel functions of the third kind, .
Definition: sph_bessel_h2n.hpp:76
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • z: Value to process.

Return value

  • returns \(h_n^{(2)}(z)\).

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
size_t n = 12;
std::cout.precision(16);
std::cout << std::scientific << std::endl;
std::cout << "1.0 " << " -> " << sph_bessel_h2n(n,1.0) << "\n";
std::cout << "1+0i " << " -> " << sph_bessel_h2n(n,kyosu::complex(1.0, 0.0)) << "\n";
std::cout << "15.0 " << " -> " << sph_bessel_h2n(n,15.0) << "\n";
std::cout << "15+0i " << " -> " << sph_bessel_h2n(n,kyosu::complex(15.0, 0.0)) << "\n";
std::cout << "40.0 " << " -> " << sph_bessel_h2n(n,40.0) << "\n";
std::cout << "40+0i " << " -> " << sph_bessel_h2n(n,kyosu::complex(40.0, 0.0)) << "\n";
std::cout << "60.0 " << " -> " << sph_bessel_h2n(n,60.0) << "\n";
std::cout << "60+0i " << " -> " << sph_bessel_h2n(n,kyosu::complex(60.0, 0.0)) << "\n";
eve::wide<double, eve::fixed<4>> z(1.0, 15.0, 40.0, 60.0);
auto zz = kyosu::complex(z);
std::cout << z << "\n -> " << sph_bessel_h2n(n,z) << "\n";
std::cout << zz << "\n -> " << kyosu::real(sph_bessel_h2n(n,zz)) << "\n";
std::cout << "1.0 " << " -> " << sph_bessel_h2n(n,1.0) << "\n";
std::cout << "1.0+36.0i " << " -> " << sph_bessel_h2n(n,kyosu::complex(1.0, 36.0)) << "\n";
std::cout << "1.0+36.0i+2.0j+1.5k " << " -> " << sph_bessel_h2n(n,kyosu::quaternion(1.0, 36.0, 2.0, 1.5)) << "\n";
eve::wide<double, eve::fixed<4>> z1(1.0, 2.0, 40.0, 0.0), z2(36.0, 0.5, 0.0, 40.0);
auto z0 = kyosu::complex(z1, z2);
std::cout << z0 << " \n-> " << sph_bessel_h2n(n,z0) << "\n";
for(int i=75; i < 100; ++i)
std::cout << "i " << i << " -> " << kyosu::sph_bessel_h2n(i,kyosu::complex(1.0, 1.0)) << "\n";
return 0;
}
constexpr tags::callable_real real
Extracts the real part of a value.
Definition: real.hpp:83
constexpr tags::callable_complex complex
Constructs a kyosu::complex.
Definition: to_complex.hpp:70
constexpr tags::callable_quaternion quaternion
Constructs a kyosu::quaternion.
Definition: to_quaternion.hpp:72
constexpr tags::callable_i i
Computes the complex number cinf i.e. complex(nan, inf) in the chosen type.
Definition: i.hpp:77