E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ cyl_bessel_kn

auto eve::cyl_bessel_kn = functor<cyl_bessel_kn_t>
inlineconstexpr

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

Header file

#include <eve/module/bessel.hpp>

Callable Signatures

namespace eve
{
// Regular overload
template<value N, floating_value T> constexpr as_wide_as_t<T,N> cyl_bessel_kn(N n, T x) noexcept; // 1
// Lanes masking
constexpr auto cyl_bessel_kn[conditional_expr auto c](value auto n, floating_value auto x) noexcept; // 2
constexpr auto cyl_bessel_kn[logical_value auto m](value auto n, floating_value auto x) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition value.hpp:34
constexpr auto cyl_bessel_kn
elementwise_callable object computing the modified Bessel function of the second kind,...
Definition cyl_bessel_kn.hpp:78
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of \(\displaystyle K_n(x)=\frac{\Gamma(n+1/2)(2x)^n}{\sqrt\pi} \int_{0}^{\infty}\frac{\cos\tau}{(\tau^2+x^2)^{n+1/2}}\,\mathrm{d}\tau\) is returned.
  2. The operation is performed conditionnaly.

External references

Example

// revision 1
#include <eve/module/bessel.hpp>
#include <iostream>
eve::wide<double> wf([](auto i, auto c)->double{ return 2*(i+c/2);});
eve::wide<std::uint64_t> wu([](auto i, auto )->std::uint64_t{ return 2*i;});
eve::wide w{0.5, 1.5, 0.1, 1.0, 19.0, 25.0, 21.5, 10000.0};
eve::wide m{0.5, -1.0, 1.5, -2.0, 2.5, -2.6, 3.2, -12.0};
int main()
{
std::cout << "<- wf = " << wf << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- m = " << m << "\n";
std::cout << "<- w = " << w << "\n";
std::cout << "-> cyl_bessel_kn(wu, wf) = " << eve::cyl_bessel_kn(wu, wf) << "\n";
std::cout << "-> cyl_bessel_kn[ignore_last(2)](wu, wf)= " << eve::cyl_bessel_kn[eve::ignore_last(2)](wu, wf) << "\n";
std::cout << "-> cyl_bessel_kn[wu != 2u](wu, wf) = " << eve::cyl_bessel_kn[wu != 2u](wu, wf) << "\n";
std::cout << "-> cyl_bessel_kn(m, w) = " << eve::cyl_bessel_kn(m, w) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:70