26 Numerics library [numerics]

26.9 Mathematical functions for floating-point types [c.math]

26.9.5 Mathematical special functions [sf.cmath]

26.9.5.17 Legendre polynomials [sf.cmath.legendre]

double legendre(unsigned l, double x); float legendref(unsigned l, float x); long double legendrel(unsigned l, long double x);

Effects: These functions compute the Legendre polynomials of their respective arguments l and x.

Returns: \[%
  \mathsf{P}_\ell(x) =
  \frac{1}
       {2^\ell \, \ell!}
  \frac{ \mathsf{d} ^ \ell}
       { \mathsf{d}x ^ \ell} \, (x^2 - 1) ^ \ell,
	   \quad \mbox{for $|x| \le 1$}
\] where l is l and x is x.

Remarks: The effect of calling each of these functions is implementation-defined if l >= 128.