E.V.E  0.1-beta

◆ laguerre

eve::laguerre = {}
inlineconstexpr

Callable object computing the laguerre operation: \(\displaystyle \mbox{L}_{n} = \frac{e^x}{n!}\frac{d^n}{dx^n}(x^ne^{-x})\) or the associated laguerre operation \(\displaystyle \mbox{L}_{n}^{m} = (-1)^m\frac{d^m}{dx^m}\mbox{L}_{n+m}(x)\).

Required header: #include <eve/function/laguerre.hpp>

Members Functions

Member Effect
operator() the laguerre operation
operator[] Construct a conditional version of current function object

auto operator()( integral_value auto n, floating_value auto x) const noexcept;
auto operator()( integral_value auto m, integral_value auto n, floating_value auto x) const noexcept;
Definition: value.hpp:83
Definition: value.hpp:42

Parameters

n, m: integral real value.

x: floating value.

Return value

Returns elementwise the value of the 'physicists' laguerre polynomial of order n at x, or if m is present the value of the associated laguerre polynomial.

The result type is of the common compatible type type of the parameters.


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::laguerre

Parameters

cond : conditional expression

Return value

A Callable object so that the expression laguerre[cond](x, ...) is equivalent to if_else(cond,laguerre(x, ...),x)


Supported decorators

  • eve::diff, eve::diff_1st, eve::diff_nth

    Required header: #include <eve/function/diff/laguerre.hpp>

    The expression diff(laguerre)(...,x) computes the derivative of the function relative to x.

  • eve::successor

    The expression successor(laguerre)(n, m, x, ln, lnm1) implements the three term recurrence relation for the Laguerre polynomials, \(\displaystyle \mbox{L}_{n+1} = \left((2n+1-x)\mbox{L}_{n}-n\mbox{L}_{n-1}\right)/(n+1)\)

    The expression successor(laguerre)(n, m, x, ln, lnmm1) implements the three term recurrence relation for the Laguerre polynomials, \(\displaystyle \mbox{L}_{n+1}^m = \left((m+2n+1-x)\mbox{L}_{n}^{m}-(m+n)\mbox{L}_{n-1}^{m}\right)/(n+1)\)

    These object functions can be used to create a sequence of values evaluated at the same x, for the same m, and for rising n.

Example

See it live on Compiler Explorer

#include <eve/function/laguerre.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.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'
<< "-> laguerre(n, xd) = " << eve::laguerre(n, xd) << '\n'
<< "-> laguerre(3, xd) = " << eve::laguerre(3, xd) << '\n'
<< "-> laguerre(n, 0.5) = " << eve::laguerre(n, 0.5) << '\n'
<< "-> laguerre(n, x) = " << eve::laguerre(n, x) << '\n';
double xs = 3.0;
std::cout << "---- scalar" << '\n'
<< "<- xs = " << xs << '\n'
<< "-> laguerre(4, xs) = " << eve::laguerre(4, xs) << '\n';
return 0;
}
constexpr callable_laguerre_ laguerre
Callable object computing the laguerre operation: or the associated laguerre operation .
Definition: laguerre.hpp:94
Wrapper for SIMD registers.
Definition: wide.hpp:65