| DEFUN_DLD (quadcc, args, nargout,"-*- texinfo -*-\n\
@deftypefn {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol})\n\
@deftypefnx {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\
Numerically evaluates an integral using the doubly-adaptive\n\
quadrature described by P. Gonnet in @cite{Increasing the\n\
Reliability of Adaptive Quadrature Using Explicit Interpolants},\n\
ACM Transactions on Mathematical Software, in Press, 2010.\n\
The algorithm uses Clenshaw-Curtis quadrature rules of increasing\n\
degree in each interval and bisects the interval if either the\n\
function does not appear to be smooth or a rule of maximum\n\
degree has been reached. The error estimate is computed from the\n\
L2-norm of the difference between two successive interpolations\n\
of the integrand over the nodes of the respective quadrature rules.\n\
\n\
For example,\n\
\n\
@example\n\
int = quadcc (f, a, b, 1.0e-6);\n\
@end example\n\
\n\
@noindent\n\
computes the integral of a function @var{f} in the interval\n\
[@var{a}, @var{b}] to the relative precision of six\n\
decimal digits.\n\
The integrand @var{f} should accept a vector argument and return a vector\n\
result containing the integrand evaluated at each element of the\n\
argument, for example:\n\
\n\
@example\n\
f = @@(x) x .* sin (1 ./ x) .* sqrt (abs (1 - x));\n\
@end example\n\
\n\
If the integrand has known singularities or discontinuities\n\
in any of its derivatives inside the interval,\n\
as does the above example at x=1, these can be specified in\n\
the additional argument @var{sing} as follows\n\
\n\
@example\n\
int = quadcc (f, a, b, 1.0e-6, [ 1 ]);\n\
@end example\n\
\n\
The two additional output variables @var{err} and @var{nr_points}\n\
return an estimate of the absolute integration error and\n\
the number of points at which the integrand was evaluated\n\
respectively.\n\
If the adaptive integration did not converge, the value of\n\
@var{err} will be larger than the requested tolerance. It is\n\
therefore recommended to verify this value for difficult\n\
integrands.\n\
\n\
If either @var{a} or @var{b} are @code{+/-Inf}, @code{quadcc}\n\
integrates @var{f} by substituting the variable of integration\n\
with @code{x=tan(pi/2*u)}.\n\
\n\
@code{quadcc} is capable of dealing with non-numeric\n\
values of the integrand such as @code{NaN}, @code{Inf}\n\
or @code{-Inf}, as in the above example at x=0.\n\
If the integral diverges and @code{quadcc} detects this, \n\
a warning is issued and @code{Inf} or @code{-Inf} is returned.\n\
\n\
Note that @code{quadcc} is a general purpose quadrature algorithm\n\
and as such may be less efficient for smooth or otherwise\n\
well-behaved integrand than other methods such as\n\
@code{quadgk} or @code{trapz}.\n\
\n\
@seealso{quad, quadv, quadl, quadgk, trapz, dblquad, triplequad}\n\
@end deftypefn") |