Skip to main content

roots_legendre

Function roots_legendre 

Source
pub fn roots_legendre(n: usize) -> (Vec<f64>, Vec<f64>)
Expand description

Gauss-Legendre quadrature

Corresponds to scipy.special.roots_legendre.

The nodes are the roots of the Legendre polynomial $P_n$, and the rule is exact for polynomials of degree $2n - 1$ on $[-1, 1]$ (A&S 22.2.10).

§Panics

  • if n is zero

§See also