pub fn integrate<F, Y>(f: F, (a, b): (f64, f64), method: Integral) -> Y
where
    F: Fn(f64) -> Y + Copy,
    Y: GKIntegrable + NCIntegrable,
{
    match method {
        Integral::GaussLegendre(n) => gauss_legendre_quadrature(f, n, (a, b)),
        Integral::NewtonCotes(n) => newton_cotes_quadrature(f, n, (a, b)),
        method => gauss_kronrod_quadrature_optimized(f, (a, b), method),
    }
}
Numerical Integration

# Description
`fn integrate(f, (a,b), method) -> Y`

`Y` must implement [`GKIntegrable`] and [`NCIntegrable`], like `f64` or
`C64` (`complex` feature only).

* `f`: Target function (`Fn(f64) -> Y`)
* `(a,b)` : Target interval
* `method` : Numerical integration method

# Method

* Gauss-Legendre Quadrature (up to order 30) : `GaussLegendre(usize)`
* Newton-Cotes Quadrature: `NewtonCotes(usize)`
* Gauss-Kronrod Quadrature
* `G7K15(tol, max_iter)`
* `G10K21`
* `G15K31`
* `G20K41`
* `G25K51`
* `G30K61`
* Gauss-Kronrod Quarature with Relative Error
* `G7K15R(rtol, max_iter)`
* `G10K21R`
* `G15K31R`
* `G20K41R`
* `G25K51R`
* `G30K61R`
src/numerical/integral.rs