Integrate Alternative

Share:

Description

integrateA is a tolerance wrapper for integrate. It allows integrate to reach the maximum number of subdivisions.

Usage

1
2
3
integrateA(f, lower, upper, ..., subdivisions = 100L,
  rel.tol = .Machine$double.eps^0.25, abs.tol = rel.tol,
  stop.on.error = TRUE, keep.xy = FALSE, aux = NULL)

Arguments

f, lower, upper, ..., subdivisions, rel.tol, abs.tol, stop.on.error, keep.xy, aux

see integrate.

Details

See integrate.

See Also

integrate

Examples

1
2
3
4
5
6
f = function(x) ifelse(x < 0, cos(x), sin(x))
#curve(f(x), -1, 1)
try(integrate(f, -1, 1, subdivisions=1)$value)
integrateA(f, -1, 1, subdivisions=1)$value
integrateA(f, -1, 1, subdivisions=2)$value
integrateA(f, -1, 1, subdivisions=3)$value