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

◆ hermite

auto eve::hermite = functor<hermite_t>
inlineconstexpr

The physicists Hermite polynomials are a sequence of orthogonal polynomials relative to \(e^{-x^2}\) on the \([-\infty, +\infty]\) interval satisfying the following recurrence relation:

  • \( \mathbf{H}_0(x) = 1\).
  • \( \mathbf{H}_1(x) = 2x\).
  • \( \mathbf{H}_n(x) = 2x\mathbf{H}_{n-1}(x) -2(n-1)\mathbf{H}_{n-2}x\).

Callable Signatures

#include <eve/module/polynomial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto hermite(integral_value auto n, floating_value auto x) noexcept; //1
// Lanes masking
constexpr auto hermite[conditional_expr auto c](integral_value auto n, floating_value auto x) noexcept; // 2
constexpr auto hermite[logical_value auto m](integral_value auto n, floating_value auto x) noexcept; // 2
// Semantic option
constexpr auto hermite(integral_value auto n, floating_value auto x,
floating_value auto hn, floating_value auto hnm1) 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 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 hermite
strict_elementwise_callable object computing the value of the 'physicists' Hermite polynomial of orde...
Definition hermite.hpp:108
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of the 'physicists' hermite polynomial \( \displaystyle \mathbf{H}_n(x) = (-1)^n e^{x^2}\frac{d}{dx^n}e^{-x^2}\) is returned.
  2. The operation is performed conditionnaly.
  3. implements the three terms recurrence relation for the physicists Hermite polynomials, \(\displaystyle \mbox{H}_{n+1} = (2*x)\mbox{H}_{n}-2*n\mbox{H}_{n-1}\). 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(2.0);
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- n = " << n << '\n'
<< "<- x = " << x << '\n'
<< "-> hermite(n, xd) = " << eve::hermite(n, xd) << '\n'
<< "-> hermite(3, xd) = " << eve::hermite(3, xd) << '\n'
<< "-> hermite(n, 2.0) = " << eve::hermite(n, 2.0) << '\n'
<< "-> hermite(n, x) = " << eve::hermite(n, x) << '\n'
;
double xs = 3.0;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<< "-> hermite(4, xs) = " << eve::hermite(4, xs) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:70