Skip to main content

gauss_legendre

Function gauss_legendre 

Source
pub fn gauss_legendre<F>(
    f: F,
    a: &ExactNum,
    b: &ExactNum,
    n: usize,
    p: usize,
    rm: RoundingMode,
    cc: &mut Consts,
) -> Option<ExactNum>
Expand description

Gauss–Legendre quadrature of f on [a, b] with n nodes.

Nodes are roots of P_n; weights w_i = 2 / ((1-x_i²) [P_n'(x_i)]²). Exact for polynomials of degree ≤ 2n−1. None if n is 0 or greater than QUADRATURE_MAX_NODES, the interval is not a finite a < b, or a root fails to converge.