XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ legendre()

double legendre ( unsigned int  n,
double  x 
)

Legendre polynomial Pn(x)

Purpose
legendre computes the Legendre polynomial.
Pn(x) = 1/(2^n n!) dn/dxn(x^2 - 1)^n
Returns
Legendre polynomial Pn(x).
Parameters
[in]nDegree of polynomial n.
[in]xArgument x (|x| <= 1).
Error handling
  • If |x| > 1, domain error (EDOM) occurs.
  • Range error (ERANGE) may occur.
Note
  • Note that the worst errors occur when the degree increases, values greater than ~120 are very unlikely to produce sensible results. Further the relative errors are likely to grow arbitrarily large when the function is very close to a root.
Reference
boost/math/special_functions