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

Detailed Description

Numerical function objects.

This module provides all the numerical functions and function objects usable on EVE types.

Contents

 Bessel function
 Bessel functions.
 Combinatorial functions
 Combinatorial functions.
 Core functions
 Core functions.
 Elliptic functions
 Elliptic functions.
 Mathematical functions
 Current Mathematical functions.
 Polynomial functions
 This module provides implementation for scalar and SIMD versions of polynomial evaluation functions.
 Special functions
 Special functions.

Variables

constexpr auto eve::bessel_i = eve::functor<bessel_i_t>
 Computes the spherical or cylindrical Modified Bessel functions of the first kind,.
constexpr auto eve::bessel_j = eve::functor<bessel_j_t>
 Computes the spherical or cylindrical Bessel functions of the first kind,.
constexpr auto eve::bessel_k = eve::functor<bessel_k_t>
 Computes the modified spherical or cylindrical Bessel functions of the second kind,.
constexpr auto eve::bessel_y = eve::functor<bessel_y_t>
 Computes the spherical or cylindrical Bessel functions of the second kind,.

Variable Documentation

◆ bessel_i

auto eve::bessel_i = eve::functor<bessel_i_t>
inlineconstexpr

Computes the spherical or cylindrical Modified Bessel functions of the first kind,.

#include <eve/functions.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bessel_i(value auto n, floating_value auto z) noexcept; // 1
// Semantic modifier
constexpr auto bessel_i[cylindrical](value auto n, floating_value auto z) noexcept; // 1
constexpr auto bessel_i[spherical](value auto n, floating_value auto z) noexcept; // 2
// Lanes masking
constexpr auto bessel_i[conditional_expr auto c](/*any previous overload*/) noexcept; // 3
constexpr auto bessel_i[logical_value auto m](/*any previous overload*/) noexcept; // 3
}
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:134
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 cylindrical
Selects the cylindrical form of a Bessel function.
Definition core.hpp:77
constexpr auto spherical
Selects the spherical form of a Bessel function.
Definition core.hpp:97
constexpr auto bessel_i
Computes the spherical or cylindrical Modified Bessel functions of the first kind,...
Definition bessel_i.hpp:82
EVE Main Namespace.
Definition abi.hpp:19

Parameters

  • n: order (integral or floating)
  • z: Value to process.
  • m: Logical value masking the operation.

Return value

  1. returns \(Y_n\)(z) (cylindrical).
  2. returns \(y_n\)(z) (spherical).
  3. The operation is performed conditionally.

External references

Example

#include <eve/eve.hpp>
#include <eve/module/bessel.hpp>
#include <iostream>
int main()
{
eve::wide<double> wdf([](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 wd{0.5, 1.5, 0.1, 1.0, 19.0, 0.0, 0.0, 10000.0};
eve::wide m{0.5, -1.0, 1.5, -2.0, 2.5, -2.6, 3.2, -12.0};
std::cout << "<- wdf = " << wdf << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- m = " << m << "\n";
std::cout << "<- wd = " << wd << "\n";
std::cout << "-> bessel_j(wu, wdf) = " << eve::bessel_j(wu, wdf) << "\n";
std::cout << "-> bessel_j[ignore_last(2)](wu, wdf)= " << eve::bessel_j[eve::ignore_last(2)](wu, wdf) << "\n";
std::cout << "-> bessel_j[wu != 2u](wu, wdf) = " << eve::bessel_j[wu != 2u](wu, wdf) << "\n";
std::cout << "-> bessel_j(m, wd) = " << eve::bessel_j(m, wd) << "\n";
std::cout << "-> bessel_j[spherical](m, wd) = " << eve::bessel_j[eve::spherical](m, wd) << "\n";
}
constexpr auto bessel_j
Computes the spherical or cylindrical Bessel functions of the first kind,.
Definition bessel_j.hpp:85
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:361
Wrapper for SIMD registers.
Definition wide.hpp:94

◆ bessel_j

auto eve::bessel_j = eve::functor<bessel_j_t>
inlineconstexpr

Computes the spherical or cylindrical Bessel functions of the first kind,.

#include <eve/functions.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bessel_j(value auto n, floating_value auto z) noexcept; // 1
// Semantic modifier
constexpr auto bessel_j[cylindrical](value auto n, floating_value auto z) noexcept; // 1
constexpr auto bessel_j[spherical](value auto n, floating_value auto z) noexcept; // 2
// Lanes masking
constexpr auto bessel_j[conditional_expr auto c](/*any previous overload*/) noexcept; // 3
constexpr auto bessel_j[logical_value auto m](/*any previous overload*/) noexcept; // 3
}

Parameters

  • n: order (integral or floating)
  • z: Value to process.
  • m: Logical value masking the operation.

Return value

  1. returns \(J_n\)(z) (cylindrical).
  2. returns \(j_n\)(z) (spherical).
  3. The operation is performed conditionally.
Note
if n is not integral nor flint negative z entries produce NaN outputs as the correct result is not real. You may want to use KYOSU to avoid this behavior and produce complex outputs (that are not available in EVE).

External references

Example

#include <eve/eve.hpp>
#include <eve/module/bessel.hpp>
#include <iostream>
int main()
{
eve::wide<double> wdf([](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 wd{0.5, 1.5, 0.1, 1.0, 19.0, 0.0, 0.0, 10000.0};
eve::wide m{0.5, -1.0, 1.5, -2.0, 2.5, -2.6, 3.2, -12.0};
std::cout << "<- wdf = " << wdf << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- m = " << m << "\n";
std::cout << "<- wd = " << wd << "\n";
std::cout << "-> bessel_j(wu, wdf) = " << eve::bessel_j(wu, wdf) << "\n";
std::cout << "-> bessel_j[ignore_last(2)](wu, wdf)= " << eve::bessel_j[eve::ignore_last(2)](wu, wdf) << "\n";
std::cout << "-> bessel_j[wu != 2u](wu, wdf) = " << eve::bessel_j[wu != 2u](wu, wdf) << "\n";
std::cout << "-> bessel_j(m, wd) = " << eve::bessel_j(m, wd) << "\n";
std::cout << "-> bessel_j[spherical](m, wd) = " << eve::bessel_j[eve::spherical](m, wd) << "\n";
}

◆ bessel_k

auto eve::bessel_k = eve::functor<bessel_k_t>
inlineconstexpr

Computes the modified spherical or cylindrical Bessel functions of the second kind,.

#include <eve/functions.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bessel_k(value auto n, floating_value auto z) noexcept; // 1
// Semantic modifier
constexpr auto bessel_k[cylindrical](value auto n, floating_value auto z) noexcept; // 1
constexpr auto bessel_k[spherical](value auto n, floating_value auto z) noexcept; // 2
// Lanes masking
constexpr auto bessel_k[conditional_expr auto c](/*any previous overload*/) noexcept; // 3
constexpr auto bessel_k[logical_value auto m](/*any previous overload*/) noexcept; // 3
}
constexpr auto bessel_k
Computes the modified spherical or cylindrical Bessel functions of the second kind,...
Definition bessel_k.hpp:84

Parameters

  • n: order (integral or floating)
  • z: Value to process.
  • m: Logical value masking the operation.

Return value

  1. returns \(Y_n\)(z) (cylindrical).
  2. returns \(y_n\)(z) (spherical).
  3. The operation is performed conditionally.
Note
if n is not integral nor flint negative z entries produce NaN outputs as the correct result is not real. You may want to use KYOSU to avoid this behavior and produce complex outputs (that are not available in EVE).

External references

Example

#include <eve/eve.hpp>
#include <eve/module/bessel.hpp>
#include <iostream>
int main()
{
eve::wide<double> wdf([](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 wd{0.5, 1.5, 0.1, 1.0, 19.0, 0.0, 0.0, 10000.0};
eve::wide m{0.5, -1.0, 1.5, -2.0, 2.5, -2.6, 3.2, -12.0};
std::cout << "<- wdf = " << wdf << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- m = " << m << "\n";
std::cout << "<- wd = " << wd << "\n";
std::cout << "-> bessel_k(wu, wdf) = " << eve::bessel_k(wu, wdf) << "\n";
std::cout << "-> bessel_k[ignore_last(2)](wu, wdf)= " << eve::bessel_k[eve::ignore_last(2)](wu, wdf) << "\n";
std::cout << "-> bessel_k[wu != 2u](wu, wdf) = " << eve::bessel_k[wu != 2u](wu, wdf) << "\n";
std::cout << "-> bessel_k(m, wd) = " << eve::bessel_k(m, wd) << "\n";
std::cout << "-> bessel_k[spherical](m, wd) = " << eve::bessel_k[eve::spherical](m, wd) << "\n";
}

◆ bessel_y

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

Computes the spherical or cylindrical Bessel functions of the second kind,.

#include <eve/functions.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bessel_y(value auto n, floating_value auto z) noexcept; // 1
// Semantic modifier
constexpr auto bessel_y[cylindrical](value auto n, floating_value auto z) noexcept; // 1
constexpr auto bessel_y[spherical](value auto n, floating_value auto z) noexcept; // 2
// Lanes masking
constexpr auto bessel_y[conditional_expr auto c](/*any previous overload*/) noexcept; // 3
constexpr auto bessel_y[logical_value auto m](/*any previous overload*/) noexcept; // 3
}
constexpr auto bessel_y
Computes the spherical or cylindrical Bessel functions of the second kind,.
Definition bessel_y.hpp:84

Parameters

  • n: order (integral or floating)
  • z: Value to process.
  • m: Logical value masking the operation.

Return value

  1. returns \(Y_n\)(z) (cylindrical).
  2. returns \(y_n\)(z) (spherical).
  3. The operation is performed conditionally.
Note
if n is not integral nor flint negative z entries produce NaN outputs as the correct result is not real. You may want to use KYOSU to avoid this behavior and produce complex outputs (that are not available in EVE).

External references

Example

#include <eve/eve.hpp>
#include <eve/module/bessel.hpp>
#include <iostream>
int main()
{
eve::wide<double> wdf([](auto i, auto c)->double{ return 2*(i-c/2)+2/3.0;});
eve::wide<std::uint64_t> wu([](auto i, auto )->std::uint64_t{ return 2*i+1;});
eve::wide wd{0.5, 1.5, 0.1, 1.0, 19.0, 0.0, 0.0, 10000.0};
eve::wide m{0.5, -1.0, 1.5, -2.0, 2.5, -2.6, 3.2, -12.0};
std::cout << "<- wdf = " << wdf << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- m = " << m << "\n";
std::cout << "<- wd = " << wd << "\n";
std::cout << "-> bessel_y(wu, wdf) = " << eve::bessel_y(wu, wdf) << "\n";
std::cout << "-> bessel_y[ignore_last(2)](wu, wdf)= " << eve::bessel_y[eve::ignore_last(2)](wu, wdf) << "\n";
std::cout << "-> bessel_y[wu != 3u](wu, wdf) = " << eve::bessel_y[wu != 3u](wu, wdf) << "\n";
std::cout << "-> bessel_y(m, wd) = " << eve::bessel_y(m, wd) << "\n";
std::cout << "-> bessel_y[spherical](m, wd) = " << eve::bessel_y[eve::spherical](m, wd) << "\n";
}