3 Description

nag_1d_quad_wt_alglog (d01apc) is based upon the QUADPACK routine QAWSE (Piessens et al. (1983)) and integrates a function of the form gxwx, where the weight function wx may have algebraico-logarithmic singularities at the end-points a and/or b. The strategy is a modification of that in nag_1d_quad_osc (d01akc). We start by bisecting the original interval and applying modified Clenshaw–Curtis integration of orders 12 and 24 to both halves. Clenshaw–Curtis integration is then used on all sub-intervals which have a or b as one of their end-points (Piessens et al. (1974)). On the other sub-intervals Gauss–Kronrod (7–15 point) integration is carried out.

Before a subsequent call to nag_1d_quad_wt_alglog (d01apc) is made, or when the information contained in these arrays is no longer useful, you should free the storage allocated by these pointers using the NAG macro NAG_FREE.

On entry, max_num_subint must not be less than 2: max_num_subint=value.

NE_QUAD_BAD_SUBDIV

Extremely bad integrand behaviour occurs around the sub-interval value,value.
The same advice applies as in the case of NE_QUAD_MAX_SUBDIV.

NE_QUAD_MAX_SUBDIV

The maximum number of subdivisions has been reached: max_num_subint=value.

The maximum number of subdivisions has been reached without the accuracy requirements being achieved. Look at the integrand in order to determine the integration difficulties. If the position of a discontinuity or a singularity of algebraico-logarithmic type within the interval can be determined, the interval must be split up at this point and the integrator called on the sub-intervals. If necessary, another integrator, which is designed for handling the type of difficulty involved, must be used. Alternatively, consider relaxing the accuracy requirements specified by epsabs and epsrel, or increasing the value of max_num_subint.

NE_QUAD_ROUNDOFF_TOL

Round-off error prevents the requested tolerance from being achieved: epsabs=value, epsrel=value.
The error may be underestimated. Consider relaxing the accuracy requirements specified by epsabs and epsrel.

NE_REAL_ARG_LE

On entry, alfa=value.
Constraint: alfa≤-1.0.

On entry, beta=value.
Constraint: beta≤-1.0.

7 Accuracy

nag_1d_quad_wt_alglog (d01apc) cannot guarantee, but in practice usually achieves, the following accuracy:

I-result≤tol

where

tol=maxepsabs,epsrel×I

and epsabs and epsrel are user-specified absolute and relative error tolerances. Moreover it returns the quantity abserr which, in normal circumstances, satisfies

I-result≤abserr≤tol.

8 Further Comments

The time taken by nag_1d_quad_wt_alglog (d01apc) depends on the integrand and the accuracy required.

If the function fails with an error exit other than NE_INT_ARG_LT, NE_BAD_PARAM, NE_REAL_ARG_LE, NE_2_REAL_ARG_LE or NE_ALLOC_FAIL then you may wish to examine the contents of the structure qp. These contain the end-points of the sub-intervals used by nag_1d_quad_wt_alglog (d01apc) along with the integral contributions and error estimates over these sub-intervals.

Specifically, for i=1,2,…,n, let ri denote the approximation to the value of the integral over the sub-interval ai,bi in the partition of a,b and ei be the corresponding absolute error estimate.

Then, ∫aibigxwxdx≃ri and result=∑i=1nri. The value of n is returned in qp→num_subint, and the values ai, bi, ri and ei are stored in the structure qp as