naginterfaces.library.quad.dim1_​fin_​gonnet_​vec

naginterfaces.library.quad.dim1_fin_gonnet_vec(a, b, f, epsabs, epsrel, data=None)[source]

dim1_fin_gonnet_vec is a general purpose integrator which calculates an approximation to the integral of a function over a finite interval :

The function is suitable as a general purpose integrator, and can be used when the integrand has singularities and infinities. In particular, the function can continue if the function explicitly returns a quiet or signalling NaN or a signed infinity.

For full information please refer to the NAG Library document for d01rg

https://www.nag.com/numeric/nl/nagdoc_28.7/flhtml/d01/d01rgf.html

Parameters
afloat

, the lower limit of integration.

bfloat

, the upper limit of integration. It is not necessary that .

Note: if , the function will immediately return with , and .

fcallable (fv, iflag) = f(x, iflag, data=None)

must return the value of the integrand at a set of points.

Parameters
xfloat, ndarray, shape

The abscissae, , for , at which function values are required.

iflagint

.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
fvfloat, array-like, shape

must contain the values of the integrand . for all .

iflagint

Set to force an immediate exit with = -1.

epsabsfloat

The absolute accuracy required.

If is negative, is used.

See Accuracy.

If , only the relative error will be used.

epsrelfloat

The relative accuracy required.

If is negative, is used.

See Accuracy.

If , only the absolute error will be used otherwise the actual value of used by dim1_fin_gonnet_vec is .

dataarbitrary, optional

User-communication data for callback functions.

Returns
dinestfloat

The estimate of the definite integral .

errestfloat

The error estimate of the definite integral .

nevalsint

The total number of points at which the integrand, , has been evaluated.

Raises
NagValueError
(errno )

Both and .

Warns
NagAlgorithmicWarning
(errno )

Exit requested from with .

(errno )

The requested accuracy was not achieved. Consider using larger values of and .

(errno )

The integral is probably divergent or slowly convergent.

Notes

dim1_fin_gonnet_vec uses the algorithm described in Gonnet (2010). It is an adaptive algorithm, similar to the QUADPACK routine QAGS (see Piessens et al. (1983), see also dim1_gen_vec_multi_rcomm()) but includes significant differences regarding how the integrand is represented, how the integration error is estimated and how singularities and divergent integrals are treated. The local error estimation is described in Gonnet (2010).

dim1_fin_gonnet_vec requires a function to evaluate the integrand at an array of different points and is, therefore, amenable to parallel execution.

References

Gonnet, P, 2010, Increasing the reliability of adaptive quadrature using explicit interpolants, ACM Trans. Math. software (37), 26

Piessens, R, de Doncker–Kapenga, E, Überhuber, C and Kahaner, D, 1983, QUADPACK, A Subroutine Package for Automatic Integration, Springer–Verlag