Skip to main content

roots_sh_legendre

Function roots_sh_legendre 

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

Gauss-Legendre (shifted) quadrature

Corresponds to scipy.special.roots_sh_legendre.

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

§Panics

  • if n is zero

§See also