naginterfaces.library.quad.dim1_fin_wcauchy(g, a, b, c, epsabs, epsrel, lw=800, liw=None, data=None)[source]

dim1_fin_wcauchy calculates an approximation to the Hilbert transform of a function over :

for user-specified values of , and .

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

gcallable retval = g(x, data=None)

must return the value of the function at a given point .


The point at which the function must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.


The value of evaluated at .


, the lower limit of integration.


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


The argument in the weight function.


The absolute accuracy required. If is negative, the absolute value is used. See Accuracy.


The relative accuracy required. If is negative, the absolute value is used. See Accuracy.

lwint, optional

The value of (together with that of ) imposes a bound on the number of sub-intervals into which the interval of integration may be divided by the function. The number of sub-intervals cannot exceed . The more difficult the integrand, the larger should be.

liwNone or int, optional

Note: if this argument is None then a default value will be used, determined as follows: .

The number of sub-intervals into which the interval of integration may be divided cannot exceed .

dataarbitrary, optional

User-communication data for callback functions.


The approximation to the integral .


An estimate of the modulus of the absolute error, which should be an upper bound for .

wfloat, ndarray, shape

Details of the computation see Further Comments for more information.

iwint, ndarray, shape

contains the actual number of sub-intervals used. The rest of the array is used as workspace.

(errno )

On entry, , and .

Constraint: and .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

The maximum number of subdivisions () has been reached: , and .

(errno )

Round-off error prevents the requested tolerance from being achieved: and .

(errno )

Extremely bad integrand behaviour occurs around the sub-interval .


In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dim1_fin_wcauchy is based on the QUADPACK routine QAWC (see Piessens et al. (1983)) and integrates a function of the form , where the weight function

is that of the Hilbert transform. (If the integral has to be interpreted in the sense of a Cauchy principal value.) It is an adaptive function which employs a ‘global’ acceptance criterion (as defined by Malcolm and Simpson (1976)). Special care is taken to ensure that is never the end point of a sub-interval (see Piessens et al. (1976)). On each sub-interval modified Clenshaw–Curtis integration of orders and is performed if where . Otherwise the Gauss -point and Kronrod -point rules are used. The local error estimation is described by Piessens et al. (1983).


Malcolm, M A and Simpson, R B, 1976, Local versus global strategies for adaptive quadrature, ACM Trans. Math. Software (1), 129–146

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

Piessens, R, van Roy–Branders, M and Mertens, I, 1976, The automatic evaluation of Cauchy principal value integrals, Angew. Inf. (18), 31–35