pracma (version 1.9.9)

gauss_kronrod: Gauss-Kronrod Quadrature

Description

Simple Gaussian-Kronrod quadrature formula.

Usage

gauss_kronrod(f, a, b, ...)

Arguments

f
function to be integrated.
a, b
end points of the interval.
...
variables to be passed to the function.

Value

List of value and relative error.

Details

Gaussian quadrature of degree 7 with Gauss-Kronrod of degree 15 for error estimation, the quadQK15 procedure in the QUADPACK library.

References

Fausett, L. V. (2007). Applied Numerical Analysis Using Matlab. Second edition, Prentice Hall.

See Also

quadgk, romberg

Examples

Run this code
gauss_kronrod(sin, 0, pi)  #  2.000000000000000 , rel.error: 1.14e-12
gauss_kronrod(exp, 0, 1)   #  1.718281828459045 , rel.error: 0
                           #  1.718281828459045 , i.e. exp(1) - 1

Run the code above in your browser using DataLab