gauss_kronrod: Gauss-Kronrod Quadrature

Description Usage Arguments Details Value Note References See Also Examples

View source: R/gauss_kronrod.R

Description

Simple Gaussian-Kronrod quadrature formula.

Usage

1
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.

Details

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

Value

List of value and relative error.

Note

The function needs to be vectorized (though this could easily be changed), but the function does not need to be defined at the end points.

References

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

See Also

quadgk, romberg

Examples

1
2
3
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


pracma documentation built on May 19, 2017, 8:50 a.m.
Search within the pracma package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.