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

◆ tchebytchev

auto eve::tchebytchev = functor<tchebytchev_t>
inlineconstexpr
  • The Tchebytchev polynomial of order n is given by \( \displaystyle \mbox{T}_{n}(x) = \cos(n\arccos(x))\) on \([-1, +1]\)

Header file

#include <eve/module/polynomial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto tchebytchev(integral_value auto n, floating_value auto x) noexcept; // 1
// Lanes masking
constexpr auto tchebytchev[conditional_expr auto c](integral_value auto n, floating_value auto x) noexcept; // 2
constexpr auto tchebytchev[logical_value auto m](integral_value auto n, floating_value auto x) noexcept; // 2
// Semantic options
constexpr auto tchebytchev[kind_1](integral_value auto n, floating_value auto x) noexcept; // 1
constexpr auto tchebytchev[kind_2](integral_value auto n, floating_value auto x) noexcept; // 3
constexpr auto tchebytchev[successor](floating_value auto x, integral_value auto tn,
integral_value auto tnm1) noexcept; // 4
}
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 integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
constexpr auto tchebytchev
Computes the value of the Tchebytchev polynomial of order n at x:
Definition tchebytchev.hpp:99
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

1.The value of the polynomial at x is returned.

  1. The operation is performed conditionnaly.
  2. evaluates the nth polynomial of tchebytchev of second kind \( \displaystyle U_n(x) = \frac{\sin(n\arccos x)}{\sin(\arccos x)}\). on \([-1, +1]\).
  3. computes the value of \(T_{n+1}(x)\) knowing the values tn = \(T_n(x)\) and tnm1 = \(T_{n-1}(x)\), This call can be used to create a sequence of values evaluated at the same x and for rising n.

External references

Example

#include <eve/module/polynomial.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft xd = {0.5, -1.5, 0.1, -1.0, 19.0, 25.0, 21.5, 10000.0};
wide_it n = {0, 1, 2, 3, 4, 5, 6, 7};
wide_ft x(0.5);
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- n = " << n << '\n'
<< "<- x = " << x << '\n'
<< "-> tchebytchev(n, xd) = " << eve::tchebytchev(n, xd) << '\n'
<< "-> tchebytchev(3, xd) = " << eve::tchebytchev(3, xd) << '\n'
<< "-> tchebytchev(n, 2.0) = " << eve::tchebytchev(n, 2.0) << '\n'
<< "-> tchebytchev(n, x) = " << eve::tchebytchev(n, x) << '\n'
;
double xs = 3.0;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<< "-> tchebytchev(4, xs) = " << eve::tchebytchev(4.0, xs) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86