<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>D01FCF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/D01/d01fcf.pdf">D01FCF (PDF version)</a></div><div><a class="chap" href="d01conts.xml">D01 Chapter Contents</a></div><div><a class="chapint" href="d01intro.xml">D01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>D01FCF</h1>
 <div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">D01FCF attempts to evaluate a multi-dimensional integral (up to <m:math><m:mn>15</m:mn></m:math>&#160;dimensions), with constant and finite limits, to a specified relative accuracy, using an adaptive subdivision strategy.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;D01FCF&#160;(</td><td class="tdfspec2"><a class="arg" href="#NDIM">NDIM</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#B">B</a>, <a class="arg" href="#MINPTS">MINPTS</a>, <a class="arg" href="#MAXPTS">MAXPTS</a>, <a class="arg" href="#FUNCTN">FUNCTN</a>, <a class="arg" href="#EPS">EPS</a>, <a class="arg" href="#ACC">ACC</a>, <a class="arg" href="#LENWRK">LENWRK</a>, <a class="arg" href="#WRKSTR">WRKSTR</a>, <a class="arg" href="#FINVAL">FINVAL</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NDIM, MINPTS, MAXPTS, LENWRK, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A(NDIM), B(NDIM), FUNCTN, EPS, ACC, WRKSTR(LENWRK), FINVAL</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">FUNCTN</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D01FCF returns an estimate of a multi-dimensional integral over a hyper-rectangle (i.e., with constant limits), and also an estimate of the relative error.  You set the relative accuracy required, return values for the integrand via a routine argument <a class="arg" href="#FUNCTN">FUNCTN</a>, and also set the minimum and maximum acceptable number of calls to <a class="arg" href="#FUNCTN">FUNCTN</a> (in <a class="arg" href="#MINPTS">MINPTS</a> and <a class="arg" href="#MAXPTS">MAXPTS</a>).</div><div class="paramtext">The routine operates by repeated subdivision of the hyper-rectangular region into smaller hyper-rectangles.  In each subregion, the integral is estimated using a seventh-degree rule, and an error estimate is obtained by comparison with a fifth-degree rule which uses a subset of the same points.  The fourth differences of the integrand along each co-ordinate axis are evaluated, and the subregion is marked for possible future subdivision in half along that co-ordinate axis which has the largest absolute fourth difference.</div><div class="paramtext">If the estimated errors, totalled over the subregions, exceed the requested relative error (or if fewer than <a class="arg" href="#MINPTS">MINPTS</a> calls to <a class="arg" href="#FUNCTN">FUNCTN</a> have been made), further subdivision is necessary, and is performed on the subregion with the largest estimated error, that subregion being halved along the appropriate co-ordinate axis.</div><div class="paramtext">The routine will fail if the requested relative error level has not been attained by the time <a class="arg" href="#MAXPTS">MAXPTS</a> calls to <a class="arg" href="#FUNCTN">FUNCTN</a> have been made; or, if the amount <a class="arg" href="#LENWRK">LENWRK</a> of working storage is insufficient.  A formula for the recommended value of <a class="arg" href="#LENWRK">LENWRK</a> is given in <a class="sec" href="#parameters">Section 5</a>.  If a smaller value is used, and is exhausted in the course of execution, the routine switches to a less efficient mode of operation; only if this mode also breaks down is insufficient storage reported.</div><div class="paramtext">D01FCF is based on the HALF subroutine developed by <a class="ref" href="#ref020">van Dooren and de Ridder (1976)</a>.  It uses a different basic rule, described in <a class="ref" href="#ref021">Genz and Malik (1980)</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref021" id="ref021"/>Genz A C and Malik A A (1980)  An Adaptive Algorithm for Numerical Integration over an N-dimensional Rectangular Region <i>J. Comput. Appl. Math.</i> <b>6</b> 295&#8211;302 </div>
<div class="paramtext"><a name="ref020" id="ref020"/>van Dooren P and de Ridder L (1976)  An adaptive algorithm for numerical integration over an N-dimensional cube <i>J. Comput. Appl. Math.</i> <b>2</b> 207&#8211;217 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="NDIM" id="NDIM"/>1: &#160;&#160;&#8194; NDIM &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 

<m:math><m:mi>n</m:mi></m:math>, the number of dimensions of the integral.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>2</m:mn><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>15</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="A" id="A"/>2: &#160;&#160;&#8194; A(<a class="arg" href="#NDIM">NDIM</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the lower limits of integration, <m:math><m:msub><m:mi>a</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="B" id="B"/>3: &#160;&#160;&#8194; B(<a class="arg" href="#NDIM">NDIM</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the upper limits of integration, <m:math><m:msub><m:mi>b</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="MINPTS" id="MINPTS"/>4: &#160;&#160;&#8194; MINPTS &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: must be set to the minimum number of integrand evaluations to be allowed.</div>
<div class="paramtext"><i>On exit</i>: contains the actual number of integrand evaluations used by D01FCF.</div></dd><dt class="paramhead"><a name="MAXPTS" id="MAXPTS"/>5: &#160;&#160;&#8194; MAXPTS &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the maximum number of integrand evaluations to be allowed.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXPTS"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXPTS</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MINPTS"><m:mi mathcolor="#EE0000" mathvariant="bold">MINPTS</m:mi></m:maction></m:math>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXPTS"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXPTS</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mi>&#945;</m:mi></m:math>, 
where <m:math><m:mi>&#945;</m:mi><m:mo>=</m:mo><m:msup><m:mn>2</m:mn><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction></m:msup><m:mo>+</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="FUNCTN" id="FUNCTN"/>6: &#160;&#160;&#8194; FUNCTN &#8211; <span class="bitalic">double precision</span> FUNCTION, supplied by the user.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext"><a class="arg" href="#FUNCTN">FUNCTN</a> must return the value of the integrand <m:math><m:mi>f</m:mi></m:math>&#160;at a given point.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#FUNCTN">FUNCTN</a> is:</div><table class="fspec"><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b>&#160;FUNCTION&#160;FUNCTN&#160;(</td><td class="tdfspec2"><a class="arg" href="../D01/d01fcf.xml#FUNCTN_NDIM">NDIM</a>, <a class="arg" href="../D01/d01fcf.xml#FUNCTN_Z">Z</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NDIM</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">Z(NDIM)</td></tr></table>
<dl><dt class="paramhead"><a name="FUNCTN_NDIM" id="FUNCTN_NDIM"/>1: &#160;&#160;&#8194; NDIM &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mi>n</m:mi></m:math>, the number of dimensions of the integral.</div></dd><dt class="paramhead"><a name="FUNCTN_Z" id="FUNCTN_Z"/>2: &#160;&#160;&#8194; Z(<a class="arg" href="../D01/d01fcf.xml#FUNCTN_NDIM">NDIM</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the co-ordinates of the point at which the integrand <m:math><m:mi>f</m:mi></m:math>&#160;must be evaluated.</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#FUNCTN">FUNCTN</a> must be declared as EXTERNAL in the (sub)program from which D01FCF is called. Parameters denoted as <span class="italic">Input</span>  must <b>not</b>  be changed by this procedure.</div>
</dd><dt class="paramhead"><a name="EPS" id="EPS"/>7: &#160;&#160;&#8194; EPS &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the relative error acceptable to you. When the solution is zero or very small relative accuracy may not be achievable but you may still set <a class="arg" href="#EPS">EPS</a> to a reasonable value and check for the error exit <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq2"><m:mn mathcolor="#003399" mathvariant="bold">2</m:mn></m:maction></m:math>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="ACC" id="ACC"/>8: &#160;&#160;&#8194; ACC &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the estimated relative error in <a class="arg" href="#FINVAL">FINVAL</a>.</div></dd><dt class="paramhead"><a name="LENWRK" id="LENWRK"/>9: &#160;&#160;&#8194; LENWRK &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#WRKSTR">WRKSTR</a> as declared in the (sub)program from which D01FCF is called.</div>
<div class="paramtext"><i>Suggested value</i>:
  for maximum efficiency, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LENWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LENWRK</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>1</m:mn><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXPTS"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXPTS</m:mi></m:maction><m:mo>/</m:mo><m:mi>&#945;</m:mi></m:mfenced></m:math>&#160;(see parameter <a class="arg" href="#MAXPTS">MAXPTS</a> for <m:math><m:mi>&#945;</m:mi></m:math>).
<div class="paramtext">If <a class="arg" href="#LENWRK">LENWRK</a> is less than this, D01FCF will usually run less efficiently and may fail.</div></div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LENWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LENWRK</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="WRKSTR" id="WRKSTR"/>10: &#8194; WRKSTR(<a class="arg" href="#LENWRK">LENWRK</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Workspace</span></dt><dt class="paramhead"><a name="FINVAL" id="FINVAL"/>11: &#8194; FINVAL &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the best estimate obtained for the integral.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>12: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>).
<div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, because for this routine the values of the output parameters may be useful even if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>&#8800;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;on exit, the recommended value is <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div>
</div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext"><b>Note:</b> D01FCF may return useful information for one or more of the following detected errors or warnings.</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>2</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>15</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><a class="arg" href="#MAXPTS">MAXPTS</a> is too small,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LENWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LENWRK</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NDIM"><m:mi mathcolor="#EE0000" mathvariant="bold">NDIM</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0.0</m:mn></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="arg" href="#MAXPTS">MAXPTS</a> was too small to obtain the required relative accuracy <a class="arg" href="#EPS">EPS</a>.  On soft failure, <a class="arg" href="#FINVAL">FINVAL</a> and <a class="arg" href="#ACC">ACC</a> contain estimates of the integral and the relative error, but <a class="arg" href="#ACC">ACC</a> will be greater than <a class="arg" href="#EPS">EPS</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq3" id="IFeq3"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="arg" href="#LENWRK">LENWRK</a> was too small.  On soft failure, <a class="arg" href="#FINVAL">FINVAL</a> and <a class="arg" href="#ACC">ACC</a> contain estimates of the integral and the relative error, but <a class="arg" href="#ACC">ACC</a> will be greater than <a class="arg" href="#EPS">EPS</a>.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">A relative error estimate is output through the parameter <a class="arg" href="#ACC">ACC</a>.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">Execution time will usually be dominated by the time taken to evaluate <a class="arg" href="#FUNCTN">FUNCTN</a>, and hence the maximum time that could be taken will be proportional to <a class="arg" href="#MAXPTS">MAXPTS</a>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example estimates the integral

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mn>1</m:mn></m:munderover>
 <m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mn>1</m:mn></m:munderover>
 <m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mn>1</m:mn></m:munderover>
 <m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mn>1</m:mn></m:munderover>
 <m:mfrac>
  <m:mrow>
   <m:mn>4</m:mn>
   <m:msub><m:mi>z</m:mi><m:mn>1</m:mn></m:msub>
   <m:msubsup><m:mi>z</m:mi><m:mn>3</m:mn><m:mn>2</m:mn></m:msubsup>
   <m:mrow><m:mi>exp</m:mi><m:mfenced separators="">
     <m:mn>2</m:mn>
     <m:msub><m:mi>z</m:mi><m:mn>1</m:mn></m:msub>
     <m:msub><m:mi>z</m:mi><m:mn>3</m:mn></m:msub>
    </m:mfenced></m:mrow>
  </m:mrow>
  <m:msup>
   <m:mfenced separators="">
    <m:mn>1</m:mn><m:mo>+</m:mo>
    <m:msub><m:mi>z</m:mi><m:mn>2</m:mn></m:msub><m:mo>+</m:mo>
    <m:msub><m:mi>z</m:mi><m:mn>4</m:mn></m:msub>
   </m:mfenced>
   <m:mn>2</m:mn>
  </m:msup>
 </m:mfrac>
 <m:mrow><m:mi>d</m:mi><m:msub><m:mi>z</m:mi><m:mn>4</m:mn></m:msub></m:mrow>
 <m:mi>d</m:mi><m:msub><m:mi>z</m:mi><m:mn>3</m:mn></m:msub>
 <m:mi>d</m:mi><m:msub><m:mi>z</m:mi><m:mn>2</m:mn></m:msub>
 <m:mi>d</m:mi><m:msub><m:mi>z</m:mi><m:mn>1</m:mn></m:msub>
 <m:mo>=</m:mo>
 <m:mn>0.575364</m:mn>
 <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext">The accuracy requested is one part in <m:math><m:mn>10000</m:mn></m:math>.</div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/d01fcfe.f">Program Text (d01fcfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<div class="paramtext">None.</div><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/d01fcfe.r">Program Results (d01fcfe.r)</a></p><hr/><div><a class="rout" href="../../pdf/D01/d01fcf.pdf">D01FCF (PDF version)</a></div><div><a class="chap" href="d01conts.xml">D01 Chapter Contents</a></div><div><a class="chapint" href="d01intro.xml">D01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
