Computes the value of the Jacobi polynomials \(P^{\alpha, \beta}_n(x)\).
The Jacobi polynomials are a sequence of orthogonal polynomials relative to \((1-x)^{\alpha}(1+x)^{\beta}\), for \(\alpha \) and \(\beta \) greater than -1, on the \([-1, +1]\) interval.
They can be defined via a Rodrigues formula: \(\displaystyle P^{\alpha, \beta}_n(x) = \frac{(-1)^n}{2^n n!}(1-x)^{-\alpha}
(1+x)^{-\beta} \frac{d}{dx^n}\left\{ (1-x)^{\alpha}(1+x)^{\beta}(1-x^2)^n \right\}\).
{
eve::as_wide_as<common_compatible_value<T, A, B>, N>
}
Definition: value.hpp:103
constexpr callable_jacobi_ jacobi
Computes the value of the Jacobi polynomials .
Definition: jacobi.hpp:66
constexpr callable_beta_ beta
Computes the beta function: is returned.
Definition: beta.hpp:66
Definition: all_of.hpp:22
The value of the polynomial \(P^{\alpha, \beta}_n(x)\) is returned.
#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);
wide_ft aa{-0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0};
double a = -3/8.0;
double b = 0.25;
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- n = " << n << '\n'
<< "<- x = " << x << '\n'
<<
"-> jacobi(n, a, b, xd) = " <<
eve::jacobi(n, a, b, xd) <<
'\n'
<<
"-> jacobi(4, a, b, xd) = " <<
eve::jacobi(4, a, b, xd) <<
'\n'
<<
"-> jacobi(4, a, b, x) = " <<
eve::jacobi(4, a, b, x) <<
'\n'
<<
"-> jacobi(n, a, b 0.5) = " <<
eve::jacobi(n, a, b, 0.5) <<
'\n'
<<
"-> jacobi(n, a, b, x) = " <<
eve::jacobi(n, a, b, x) <<
'\n'
<<
"-> jacobi(n, aa, b, x) = " <<
eve::jacobi(n, aa, b, x) <<
'\n'
;
double xs = 0.5;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<<
"-> jacobi(4, xs) = " <<
eve::jacobi(4, a, b, xs) <<
'\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65