<?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>E04JYF : 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/E04/e04jyf.pdf">E04JYF (PDF version)</a></div><div><a class="chap" href="e04conts.xml">E04 Chapter Contents</a></div><div><a class="chapint" href="e04intro.xml">E04 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/>E04JYF</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">E04JYF is an easy-to-use quasi-Newton algorithm for finding a minimum of a function <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:mfenced></m:math>, subject to fixed upper and lower bounds of the independent variables <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:math>, using function values only.</div><div class="paramtext">It is intended for functions which are continuous and which have continuous first and second derivatives (although it will usually work even if the derivatives have occasional discontinuities).</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;E04JYF&#160;(</td><td class="tdfspec2"><a class="arg" href="#N">N</a>, <a class="arg" href="#IBOUND">IBOUND</a>, <a class="arg" href="#FUNCT1">FUNCT1</a>, <a class="arg" href="#BL">BL</a>, <a class="arg" href="#BU">BU</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#F">F</a>, <a class="arg" href="#IW">IW</a>, <a class="arg" href="#LIW">LIW</a>, <a class="arg" href="#W">W</a>, <a class="arg" href="#LW">LW</a>, <a class="arg" href="#IUSER">IUSER</a>, <a class="arg" href="#RUSER">RUSER</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, IBOUND, IW(LIW), LIW, LW, IUSER(*), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">BL(N), BU(N), X(N), F, W(LW), RUSER(*)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">FUNCT1</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">E04JYF is applicable to problems of the form:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi mathvariant="normal">Minimize</m:mi>   <m:mi>F</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:mfenced><m:mtext>&#8195; subject to &#8195;</m:mtext><m:msub><m:mi>l</m:mi><m:mi>j</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>u</m:mi><m:mi>j</m:mi></m:msub><m:mtext>, &#8195;</m:mtext><m:mi>j</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></td><td class="formula2"/></tr></table></div>

when derivatives of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;are unavailable.</div><div class="paramtext">Special provision is made for problems which actually have no bounds on the <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>, problems which have only non-negativity bounds and problems in which <m:math><m:msub><m:mi>l</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>l</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mo>&#8943;</m:mo><m:mo>=</m:mo><m:msub><m:mi>l</m:mi><m:mi>n</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>u</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>u</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mo>&#8943;</m:mo><m:mo>=</m:mo><m:msub><m:mi>u</m:mi><m:mi>n</m:mi></m:msub></m:math>.  You must supply a subroutine to calculate the value of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;at any point  <m:math><m:mi>x</m:mi></m:math>.</div><div class="paramtext">From a starting point you supplied there is generated, on the basis of estimates of the gradient and the curvature of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>,  a sequence of feasible points which is intended to converge to a local minimum of the constrained function.  An attempt is made to verify that the final point is a minimum.</div><div class="paramtext">A typical iteration starts at the current point <m:math><m:mi>x</m:mi></m:math>&#160;where <m:math><m:msub><m:mi>n</m:mi><m:mi>z</m:mi></m:msub></m:math>&#160;(say) variables are free from both their bounds.  The projected gradient vector <m:math><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub></m:math>, whose elements are finite-difference approximations to the derivatives of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;with respect to the free variables, is known.  A unit lower triangular matrix <m:math><m:mi>L</m:mi></m:math>&#160;and a diagonal matrix <m:math><m:mi>D</m:mi></m:math>&#160;(both of dimension <m:math><m:msub><m:mi>n</m:mi><m:mi>z</m:mi></m:msub></m:math>), such that <m:math><m:mi>L</m:mi><m:mi>D</m:mi><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup></m:math>&#160;is a positive-definite approximation of the matrix of second derivatives with respect to the free variables (i.e., the projected Hessian) are also held.  The equations

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>L</m:mi><m:mi>D</m:mi><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:msub><m:mi>p</m:mi><m:mi>z</m:mi></m:msub><m:mo>=</m:mo><m:mo>-</m:mo><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub>
</m:math></td><td class="formula2"/></tr></table></div>

are solved to give a search direction <m:math><m:msub><m:mi>p</m:mi><m:mi>z</m:mi></m:msub></m:math>, which is expanded to an <m:math><m:mi>n</m:mi></m:math>-vector <m:math><m:mi>p</m:mi></m:math>&#160;by an insertion of appropriate zero elements.  Then <m:math><m:mi>&#945;</m:mi></m:math>&#160;is found such that <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>&#945;</m:mi><m:mi>p</m:mi></m:mfenced></m:math>&#160;is approximately a minimum (subject to the fixed bounds) with respect to <m:math><m:mi>&#945;</m:mi></m:math>; <m:math><m:mi>x</m:mi></m:math>&#160;is replaced by  <m:math><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>&#945;</m:mi><m:mi>p</m:mi></m:math>, and the matrices <m:math><m:mi>L</m:mi></m:math>&#160;and <m:math><m:mi>D</m:mi></m:math>&#160;are updated so as to be consistent with the change produced in the estimated gradient by the step <m:math><m:mi>&#945;</m:mi><m:mi>p</m:mi></m:math>.  If any variable actually reaches a bound during the search along <m:math><m:mi>p</m:mi></m:math>, it is fixed and <m:math><m:msub><m:mi>n</m:mi><m:mi>z</m:mi></m:msub></m:math>&#160;is reduced for the next iteration.  Most iterations calculate <m:math><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub></m:math>&#160;using forward differences, but central differences are used when they seem necessary.</div><div class="paramtext">There are two sets of convergence criteria &#8211; a weaker and a stronger.  Whenever the weaker criteria are satisfied, the Lagrange multipliers are estimated for all the active constraints.  If any Lagrange multiplier estimate is significantly negative, then one of the variables associated with a negative Lagrange multiplier estimate is released from its bound and the next search direction is computed in the extended subspace (i.e., <m:math><m:msub><m:mi>n</m:mi><m:mi>z</m:mi></m:msub></m:math>&#160;is increased).  Otherwise minimization continues in the current subspace provided that this is practicable.  When it is not, or when the stronger convergence criteria are already satisfied, then, if one or more Lagrange multiplier estimates are close to zero, a slight perturbation is made in the values of the corresponding variables in turn until a lower function value is obtained.  The normal algorithm is then resumed from the perturbed point.</div><div class="paramtext">If a saddle point is suspected, a local search is carried out with a view to moving away from the saddle point.  A local search is also performed when a point is found which is thought to be a constrained minimum.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref081" id="ref081"/>Gill P E and Murray W (1976)  Minimization subject to bounds on the variables <i>NPL Report NAC 72</i> National Physical Laboratory </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="N" id="N"/>1: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 

the number <m:math><m:mi>n</m:mi></m:math>&#160;of independent variables.</div>
<div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="IBOUND" id="IBOUND"/>2: &#160;&#160;&#8194; IBOUND &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates whether the facility for dealing with bounds of special forms is to be used.
<div class="paramtext">It must be set to one of the following values: 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>If you are supplying all the <m:math><m:msub><m:mi>l</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>u</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;individually.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>If there are no bounds on any <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>If all the bounds are of the form <m:math><m:mn>0</m:mn><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>If <m:math><m:msub><m:mi>l</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>l</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mo>&#8230;</m:mo><m:mo>=</m:mo><m:msub><m:mi>l</m:mi><m:mi>n</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>u</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>u</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mo>&#8230;</m:mo><m:mo>=</m:mo><m:msub><m:mi>u</m:mi><m:mi>n</m:mi></m:msub></m:math>.</dd></dl>
</div>
</div></dd><dt class="paramhead"><a name="FUNCT1" id="FUNCT1"/>3: &#160;&#160;&#8194; FUNCT1 &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext">You must supply <a class="arg" href="#FUNCT1">FUNCT1</a> to calculate the value of the function <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;at any point <m:math><m:mi>x</m:mi></m:math>.  It should be tested separately before being used with E04JYF (see the <a class="chapint" href="../E04/e04intro.xml">E04 Chapter Introduction</a>).</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#FUNCT1">FUNCT1</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;FUNCT1&#160;(</td><td class="tdfspec2"><a class="arg" href="../E04/e04jyf.xml#FUNCT1_N">N</a>, <a class="arg" href="../E04/e04jyf.xml#FUNCT1_XC">XC</a>, <a class="arg" href="../E04/e04jyf.xml#FUNCT1_FC">FC</a>, <a class="arg" href="../E04/e04jyf.xml#FUNCT1_IUSER">IUSER</a>, <a class="arg" href="../E04/e04jyf.xml#FUNCT1_RUSER">RUSER</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, IUSER(*)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">XC(N), FC, RUSER(*)</td></tr></table>
<dl><dt class="paramhead"><a name="FUNCT1_N" id="FUNCT1_N"/>1: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number <m:math><m:mi>n</m:mi></m:math>&#160;of variables.</div></dd><dt class="paramhead"><a name="FUNCT1_XC" id="FUNCT1_XC"/>2: &#160;&#160;&#8194; XC(<a class="arg" href="../E04/e04jyf.xml#FUNCT1_N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the point <m:math><m:mi>x</m:mi></m:math>&#160;at which the function value is required.</div></dd><dt class="paramhead"><a name="FUNCT1_FC" id="FUNCT1_FC"/>3: &#160;&#160;&#8194; FC &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the value of the function <m:math><m:mi>F</m:mi></m:math>&#160;at the current point <m:math><m:mi>x</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="FUNCT1_IUSER" id="FUNCT1_IUSER"/>4: &#160;&#160;&#8194; IUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER array<span class="pclass">User Workspace</span></dt><dt class="multi-paramhead"><a name="FUNCT1_RUSER" id="FUNCT1_RUSER"/>5: &#160;&#160;&#8194; RUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">User Workspace</span></dt><dd><div class="paramtext"><a class="arg" href="#FUNCT1">FUNCT1</a> is called from E04JYF with the parameters <a class="arg" href="../E04/e04jyf.xml#FUNCT1_IUSER">IUSER</a> and <a class="arg" href="../E04/e04jyf.xml#FUNCT1_RUSER">RUSER</a> as supplied to E04JYF.  You are free to use the arrays <a class="arg" href="../E04/e04jyf.xml#FUNCT1_IUSER">IUSER</a> and <a class="arg" href="../E04/e04jyf.xml#FUNCT1_RUSER">RUSER</a> to supply information to <a class="arg" href="#FUNCT1">FUNCT1</a> as an alternative to using 
COMMON. 

</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#FUNCT1">FUNCT1</a> must be declared as EXTERNAL in the (sub)program from which E04JYF 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="BL" id="BL"/>4: &#160;&#160;&#8194; BL(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: the lower bounds <m:math><m:msub><m:mi>l</m:mi><m:mi>j</m:mi></m:msub></m:math>.
<div class="paramtext">If <a class="arg" href="#IBOUND">IBOUND</a> is set to <m:math><m:mn>0</m:mn></m:math>, you must set <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:msub><m:mi>l</m:mi><m:mi>j</m:mi></m:msub></m:math>, for <m:math><m:mi>j</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>.  (If a lower bound is not specified for a particular <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>, the corresponding <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;should be set to <m:math><m:mrow><m:mo>-</m:mo><m:msup><m:mn>10</m:mn><m:mn>6</m:mn></m:msup></m:mrow></m:math>.)</div>
<div class="paramtext">If <a class="arg" href="#IBOUND">IBOUND</a> is set to <m:math><m:mn>3</m:mn></m:math>, you must set <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:msub><m:mi>l</m:mi><m:mn>1</m:mn></m:msub></m:math>; E04JYF will then set the remaining elements of <a class="arg" href="#BL">BL</a> equal to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>.</div>
</div>
<div class="paramtext"><i>On exit</i>: the lower bounds actually used by E04JYF.</div></dd><dt class="paramhead"><a name="BU" id="BU"/>5: &#160;&#160;&#8194; BU(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: the upper bounds <m:math><m:msub><m:mi>u</m:mi><m:mi>j</m:mi></m:msub></m:math>.
<div class="paramtext">If <a class="arg" href="#IBOUND">IBOUND</a> is set to <m:math><m:mn>0</m:mn></m:math>, you must set <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:msub><m:mi>u</m:mi><m:mi>j</m:mi></m:msub></m:math>, for <m:math><m:mi>j</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>.  (If an upper bound is not specified for a particular <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>, the corresponding <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;should be set to <m:math><m:msup><m:mn>10</m:mn><m:mn>6</m:mn></m:msup></m:math>.)</div>
<div class="paramtext">If <a class="arg" href="#IBOUND">IBOUND</a> is set to <m:math><m:mn>3</m:mn></m:math>, you must set <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:msub><m:mi>u</m:mi><m:mn>1</m:mn></m:msub></m:math>; E04JYF will then set the remaining elements of <a class="arg" href="#BU">BU</a> equal to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>.</div>
</div>
<div class="paramtext"><i>On exit</i>: the upper bounds actually used by E04JYF.</div></dd><dt class="paramhead"><a name="X" id="X"/>6: &#160;&#160;&#8194; X(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;must be set to an estimate of the <m:math><m:mi>j</m:mi></m:math>th component of the position of the minimum, for <m:math><m:mi>j</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>
<div class="paramtext"><i>On exit</i>: the lowest point found during the calculations.  Thus, 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>=</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, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;is the <m:math><m:mi>j</m:mi></m:math>th component of the position of the minimum.</div></dd><dt class="paramhead"><a name="F" id="F"/>7: &#160;&#160;&#8194; F &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the value of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;corresponding to the final point stored in <a class="arg" href="#X">X</a>.</div></dd><dt class="paramhead"><a name="IW" id="IW"/>8: &#160;&#160;&#8194; IW(<a class="arg" href="#LIW">LIW</a>) &#8211; INTEGER array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: 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>=</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>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq3"><m:mn mathcolor="#003399" mathvariant="bold">3</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>, the first <a class="arg" href="#N">N</a> elements of <a class="arg" href="#IW">IW</a> contain information about which variables are currently on their bounds and which are free.  Specifically, if <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;is:
<table class="standard-90"><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">fixed on its upper bound, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;is <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>;</td>
</tr><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">fixed on its lower bound, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;is <m:math><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:math>;</td>
</tr><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">effectively a constant (i.e., <m:math><m:msub><m:mi>l</m:mi><m:mi>j</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>u</m:mi><m:mi>j</m:mi></m:msub></m:math>), <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;is <m:math><m:mrow><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:math>;</td>
</tr><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">free, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;gives its position in the sequence of free variables.</td>
</tr></table> 
<div class="paramtext">In addition, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>&#160;contains the number of free variables (i.e., <m:math><m:msub><m:mi>n</m:mi><m:mi>z</m:mi></m:msub></m:math>).  The rest of the array is used as workspace.</div>
</div></dd><dt class="paramhead"><a name="LIW" id="LIW"/>9: &#160;&#160;&#8194; LIW &#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="#IW">IW</a> as declared in the (sub)program from which E04JYF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LIW"><m:mi mathcolor="#EE0000" mathvariant="bold">LIW</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="W" id="W"/>10: &#8194; W(<a class="arg" href="#LW">LW</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: 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>=</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>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq3"><m:mn mathcolor="#003399" mathvariant="bold">3</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;contains a finite-difference approximation to the <m:math><m:mi>i</m:mi></m:math>th element of the projected gradient vector <m:math><m:msub><m:mi>g</m:mi><m:mi>z</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:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.  In addition, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>&#160;contains an estimate of the condition number of the projected Hessian matrix (i.e., <m:math><m:mi>k</m:mi></m:math>).  The rest of the array is used as workspace.</div></dd><dt class="paramhead"><a name="LW" id="LW"/>11: &#8194; LW &#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="#W">W</a> as declared in the (sub)program from which E04JYF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LW"><m:mi mathcolor="#EE0000" mathvariant="bold">LW</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>/</m:mo><m:mn>2</m:mn><m:mo>+</m:mo><m:mn>12</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mrow><m:mo>,</m:mo><m:mn>13</m:mn></m:mfenced></m:mrow></m:math>.
</div></dd><dt class="paramhead"><a name="IUSER" id="IUSER"/>12: &#8194; IUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER array<span class="pclass">User Workspace</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#IUSER">IUSER</a>
must be at least
<m:math><m:mn>1</m:mn></m:math>.</div>
<div class="paramtext"><a class="arg" href="#IUSER">IUSER</a> is not used by E04JYF, but is passed directly to <a class="arg" href="#FUNCT1">FUNCT1</a> and may be used to pass information to that routine.</div></dd><dt class="paramhead"><a name="RUSER" id="RUSER"/>13: &#8194; RUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">User Workspace</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#RUSER">RUSER</a>
must be at least
<m:math><m:mn>1</m:mn></m:math>.</div>
<div class="paramtext"><a class="arg" href="#RUSER">RUSER</a> is not used by E04JYF, but is passed directly to <a class="arg" href="#FUNCT1">FUNCT1</a> and may be used to pass information to that routine.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>14: &#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> E04JYF 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="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>1</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="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</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="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>3</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="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow><m:mo>&gt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;for some  <m:math><m:mi>j</m:mi></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="#IBOUND"><m:mi mathcolor="#EE0000" mathvariant="bold">IBOUND</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BL"><m:mi mathcolor="#EE0000" mathvariant="bold">BL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>&gt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BU"><m:mi mathcolor="#EE0000" mathvariant="bold">BU</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></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="#LIW"><m:mi mathcolor="#EE0000" mathvariant="bold">LIW</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</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="#LW"><m:mi mathcolor="#EE0000" mathvariant="bold">LW</m:mi></m:maction>
   <m:mo>&lt;</m:mo>
   <m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>13</m:mn><m:mo>,</m:mo><m:mrow><m:mn>12</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>/</m:mo><m:mn>2</m:mn></m:mrow></m:mfenced></m:mrow>
  </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">There have been <m:math><m:mn>400</m:mn><m:mo>&#215;</m:mo><m:mi>n</m:mi></m:math>&#160;function evaluations, yet the algorithm does not seem to be converging.  The calculations can be restarted from the final point held in <a class="arg" href="#X">X</a>.  The error may also indicate that <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;has no minimum.</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">
The conditions for a minimum have not all been met but a lower point could not be found and the algorithm has failed.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq4" id="IFeq4"/><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>4</m:mn></m:math></dt>
<dd><div class="paramtext">
An overflow has occurred during the computation.  This is an unlikely failure, but if it occurs you should restart at the latest point given in <a class="arg" href="#X">X</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq5" id="IFeq5"/><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>5</m:mn></m:math></dt>
<dt class="multi-errorhead"><a name="IFeq6" id="IFeq6"/><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>6</m:mn></m:math></dt>
<dt class="multi-errorhead"><a name="IFeq7" id="IFeq7"/><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>7</m:mn></m:math></dt>
<dt class="multi-errorhead"><a name="IFeq8" id="IFeq8"/><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>8</m:mn></m:math></dt>
<dd>
<div class="paramtext">There is some doubt about whether the point <m:math><m:mi>x</m:mi></m:math>&#160;found by  E04JYF  is a minimum.  The degree of confidence in the result decreases as <a class="arg" href="#IFAIL">IFAIL</a> increases.  Thus, when <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="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>&#160;it is probable that the final <m:math><m:mi>x</m:mi></m:math>&#160;gives a good estimate of the position of a minimum, but when <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="#IFeq8"><m:mn mathcolor="#003399" mathvariant="bold">8</m:mn></m:maction></m:math>&#160;it is very unlikely that the routine has found a minimum.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq9" id="IFeq9"/><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>9</m:mn></m:math></dt>
<dd>
<div class="paramtext">In the search for a minimum, the modulus of one of the variables has become very large <m:math><m:mfenced separators=""><m:mo>&#8764;</m:mo><m:msup><m:mn>10</m:mn><m:mn>6</m:mn></m:msup></m:mfenced></m:math>.  This indicates that there is a mistake in <a class="arg" href="#FUNCT1">FUNCT1</a>, that your problem has no finite solution, or that the problem needs rescaling (see  <a class="sec" href="#fcomments">Section 8</a>).</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq10" id="IFeq10"/><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>10</m:mn></m:math></dt>
<dd>
<div class="paramtext">The computed set of forward-difference intervals (stored in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>9</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>9</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mspace linebreak="newline"/>
<m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>10</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mrow></m:mfenced></m:mrow></m:math>) is such that <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>9</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mi>i</m:mi></m:mrow></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;for some <m:math><m:mi>i</m:mi></m:math>.</div>
<div class="paramtext">This is an unlikely failure, but if it occurs you should attempt to select another starting point.</div>
</dd>
</dl>
<div class="paramtext">If you are dissatisfied with the result (e.g., because  <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="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq6"><m:mn mathcolor="#003399" mathvariant="bold">6</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq7"><m:mn mathcolor="#003399" mathvariant="bold">7</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq8"><m:mn mathcolor="#003399" mathvariant="bold">8</m:mn></m:maction></m:math>), it is worth restarting the calculations from a different starting point (not the point at which the failure occurred) in order to avoid the region which caused the failure.  If persistent trouble occurs and the gradient can be calculated, it may be advisable to change to a routine which uses gradients (see the <a class="chapint" href="../E04/e04intro.xml">E04 Chapter Introduction</a>).</div><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">A successful 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="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>) is made from E04JYF when (<m:math><m:mi mathvariant="normal">B1</m:mi></m:math>, <m:math><m:mi mathvariant="normal">B2</m:mi></m:math>&#160;and <m:math><m:mi mathvariant="normal">B3</m:mi></m:math>) or <m:math><m:mi mathvariant="normal">B4</m:mi></m:math>&#160;hold, and the local search confirms a minimum, where
<ul class="listind"><li class="listind"><m:math><m:mi mathvariant="normal">B1</m:mi><m:mo>&#8801;</m:mo><m:msup><m:mi>&#945;</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup><m:mo>&#215;</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msup><m:mi>p</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:mfenced><m:mo>&lt;</m:mo><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="italic">tol</m:mi></m:msub><m:mo>+</m:mo><m:msqrt><m:mi>&#949;</m:mi></m:msqrt></m:mfenced><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>1.0</m:mn><m:mo>+</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msup><m:mi>x</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:mfenced></m:mfenced></m:math></li><li class="listind"><m:math><m:mi mathvariant="normal">B2</m:mi><m:mo>&#8801;</m:mo><m:mfenced open="|" close="|" separators=""><m:msup><m:mi>F</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup><m:mo>-</m:mo><m:msup><m:mi>F</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced>
</m:msup></m:mfenced><m:mo>&lt;</m:mo><m:mfenced separators=""><m:msubsup><m:mi>x</m:mi><m:mi mathvariant="italic">tol</m:mi><m:mn>2</m:mn></m:msubsup><m:mo>+</m:mo><m:mi>&#949;</m:mi></m:mfenced><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>1.0</m:mn><m:mo>+</m:mo><m:mfenced open="|" close="|" separators=""><m:msup><m:mi>F</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:mfenced></m:mfenced></m:math></li><li class="listind"><m:math><m:mi mathvariant="normal">B3</m:mi><m:mo>&#8801;</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msubsup><m:mi>g</m:mi><m:mi>z</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msubsup></m:mfenced><m:mo>&lt;</m:mo><m:mfenced separators=""><m:msup><m:mi>&#949;</m:mi><m:mrow><m:mn>1</m:mn><m:mo>/</m:mo><m:mn>3</m:mn></m:mrow></m:msup><m:mo>+</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="italic">tol</m:mi></m:msub></m:mfenced><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>1.0</m:mn><m:mo>+</m:mo><m:mfenced open="|" close="|" separators=""><m:msup><m:mi>F</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:mfenced></m:mfenced></m:math></li><li class="listind"><m:math><m:mi mathvariant="normal">B4</m:mi><m:mo>&#8801;</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msubsup><m:mi>g</m:mi><m:mi>z</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msubsup></m:mfenced><m:mo>&lt;</m:mo><m:mn>0.01</m:mn><m:mo>&#215;</m:mo><m:msqrt><m:mi>&#949;</m:mi></m:msqrt></m:math>.</li></ul>
(Quantities with superscript <m:math><m:mi>k</m:mi></m:math>&#160;are the values at the <m:math><m:mi>k</m:mi></m:math>th iteration of the quantities mentioned in  <a class="sec" href="#description">Section 3</a>, <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="italic">tol</m:mi></m:msub><m:mo>=</m:mo><m:mn>100</m:mn><m:msqrt><m:mi>&#949;</m:mi></m:msqrt></m:math>, <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span> and  <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mo>.</m:mo></m:mfenced></m:math>&#160;denotes the Euclidean norm.  The vector <m:math><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub></m:math>&#160;is returned in the array <a class="arg" href="#W">W</a>.)</div><div class="paramtext">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>=</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>, then the vector in <a class="arg" href="#X">X</a> on exit, <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:math>, is almost certainly an estimate of the position of the minimum, <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">true</m:mi></m:msub></m:math>, to the accuracy specified by <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="italic">tol</m:mi></m:msub></m:math>.</div><div class="paramtext">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>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq3"><m:mn mathcolor="#003399" mathvariant="bold">3</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:math>&#160;may still be a good estimate of <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">true</m:mi></m:msub></m:math>, but the following checks should be made.  Let <m:math><m:mi>k</m:mi></m:math>&#160;denote an estimate of the condition number of the projected Hessian matrix at <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:math>.  (The value of <m:math><m:mi>k</m:mi></m:math>&#160;is returned in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>).  If
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(i)</td>
<td valign="top">the sequence <m:math><m:mfenced open="{" close="}" separators=""><m:mi>F</m:mi><m:mfenced separators=""><m:msup><m:mi>x</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:mfenced></m:mfenced></m:math>&#160;converges to  <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:mfenced></m:math>&#160;at a superlinear or a fast linear rate,</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(ii)</td>
<td valign="top"><m:math><m:msup><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">xol</m:mi></m:msub></m:mfenced></m:mfenced><m:mn>2</m:mn></m:msup><m:mo>&lt;</m:mo><m:mn>10.0</m:mn><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>, and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(iii)</td>
<td valign="top"><m:math><m:mi>k</m:mi><m:mo>&lt;</m:mo><m:mn>1.0</m:mn><m:mo>/</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msub><m:mi>g</m:mi><m:mi>z</m:mi></m:msub><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:mfenced></m:mfenced></m:math>,</td>
</tr></table>
then it is almost certain that <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:math>&#160;is a close approximation to the position of a minimum.  When (ii) is true, then usually <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">sol</m:mi></m:msub></m:mfenced></m:math>&#160;is a close approximation to <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">true</m:mi></m:msub></m:mfenced></m:math>.</div><div class="paramtext">When a successful exit is made then, for a computer with a mantissa of <m:math><m:mi>t</m:mi></m:math>&#160;decimals, one would expect to get about <m:math><m:mi>t</m:mi><m:mo>/</m:mo><m:mn>2</m:mn><m:mo>-</m:mo><m:mn>1</m:mn></m:math>&#160;decimals accuracy in <m:math><m:mi>x</m:mi></m:math>&#160;and about <m:math><m:mi>t</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:math>&#160;decimals accuracy in <m:math><m:mi>F</m:mi></m:math>, provided the problem is reasonably well scaled.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The number of iterations required depends on the number of variables, the behaviour of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and the distance of the starting point from the solution.  The number of operations performed in an iteration of E04JYF is roughly proportional to <m:math><m:msup><m:mi>n</m:mi><m:mn>2</m:mn></m:msup></m:math>.  In addition, each iteration makes at least <m:math><m:mi>m</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;calls of <a class="arg" href="#FUNCT1">FUNCT1</a>, where <m:math><m:mi>m</m:mi></m:math>&#160;is the number of variables not fixed on bounds.  So, unless <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;can be evaluated very quickly, the run time will be dominated by the time spent in <a class="arg" href="#FUNCT1">FUNCT1</a>.</div><div class="paramtext">Ideally the problem should be scaled so that at the solution the value of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and the corresponding values of  <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:math>&#160;are each in the range  <m:math><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mo>,</m:mo><m:mrow><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:math>, and so that at points a unit distance away from the solution, <m:math><m:mi>F</m:mi></m:math>&#160;is approximately a unit value greater than at the minimum.  It is unlikely that you will be able to follow these recommendations very closely, but it is worth trying (by guesswork), as sensible scaling will reduce the difficulty of the minimization problem, so that E04JYF will take less computer time.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">To minimize

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>F</m:mi><m:mo>=</m:mo><m:msup>
<m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>+</m:mo><m:mn>10</m:mn><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:mfenced>
<m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#8290;</m:mo><m:msup>
<m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub><m:mo>-</m:mo><m:msub><m:mi>x</m:mi><m:mn>4</m:mn></m:msub></m:mfenced>
<m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:msup>
<m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>-</m:mo><m:mn>2</m:mn><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub></m:mfenced>
<m:mn>4</m:mn></m:msup><m:mo>+</m:mo><m:mn>10</m:mn><m:mo>&#8290;</m:mo><m:msup>
<m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>-</m:mo><m:msub><m:mi>x</m:mi><m:mn>4</m:mn></m:msub></m:mfenced>
<m:mn>4</m:mn></m:msup>
</m:math></td><td class="formula2"/></tr></table></div>

subject to

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable>
 <m:mtr>
  <m:mtd><m:mphantom><m:mo>-</m:mo></m:mphantom><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>&#8804;</m:mo> <m:mn>3</m:mn><m:mphantom><m:mo>,</m:mo></m:mphantom></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>&#8804;</m:mo> <m:mn>0</m:mn><m:mphantom><m:mo>,</m:mo></m:mphantom></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mphantom><m:mo>-</m:mo></m:mphantom><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>4</m:mn></m:msub><m:mo>&#8804;</m:mo> <m:mn>3</m:mn><m:mtext>,</m:mtext></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

starting from the initial guess <m:math>
 <m:mfenced separators=""><m:mn>3</m:mn><m:mo>,</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mo>,</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn></m:mfenced>
</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/e04jyfe.f">Program Text (e04jyfe.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/e04jyfe.r">Program Results (e04jyfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/E04/e04jyf.pdf">E04JYF (PDF version)</a></div><div><a class="chap" href="e04conts.xml">E04 Chapter Contents</a></div><div><a class="chapint" href="e04intro.xml">E04 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>
