<?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>E04GZF : 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/e04gzf.pdf">E04GZF (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/>E04GZF</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">E04GZF is an easy-to-use modified Gauss&#8211;Newton algorithm for finding an unconstrained minimum of a sum of squares of <m:math><m:mi>m</m:mi></m:math>&#160;nonlinear functions in <m:math><m:mi>n</m:mi></m:math>&#160;variables <m:math><m:mfenced separators=""><m:mi>m</m:mi><m:mo>&#8805;</m:mo><m:mi>n</m:mi></m:mfenced></m:math>.  First derivatives are required.</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;E04GZF&#160;(</td><td class="tdfspec2"><a class="arg" href="#M">M</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#LSFUN2">LSFUN2</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#FSUMSQ">FSUMSQ</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">M, N, LW, IUSER(*), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X(N), FSUMSQ, W(LW), RUSER(*)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">LSFUN2</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">E04GZF is similar to the subroutine LSFDN2 in the NPL Algorithms Library.  It is applicable to problems of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:mi>Minimize</m:mi><m:mo>&#8289;</m:mo><m:mi>F</m:mi></m:mrow><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>m</m:mi></m:munderover><m:msup><m:mfenced open="[" close="]" separators=""><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mfenced><m:mn>2</m:mn></m:msup>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>x</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: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:mi mathvariant="normal">T</m:mi></m:msup></m:math>&#160;and <m:math><m:mi>m</m:mi><m:mo>&#8805;</m:mo><m:mi>n</m:mi></m:math>.  (The functions <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;are often referred to as &#8216;residuals&#8217;.)</div><div class="paramtext">You must supply a subroutine to evaluate the residuals and their first derivatives at any point <m:math><m:mi>x</m:mi></m:math>.</div><div class="paramtext">Before attempting to minimize the sum of squares, the algorithm checks the subroutine for consistency.  Then, from a starting point supplied by you, a sequence of points is generated which is intended to converge to a local minimum of the sum of squares.  These points are generated using estimates of the curvature of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref080" id="ref080"/>Gill P E and Murray W (1978)  Algorithms for the solution of the nonlinear least-squares problem <i>SIAM J. Numer. Anal.</i> <b>15</b> 977&#8211;992 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="M" id="M"/>1: &#160;&#160;&#8194; M &#8211; INTEGER<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="N" id="N"/>2: &#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>m</m:mi></m:math>&#160;of residuals, <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, and the number <m:math><m:mi>n</m:mi></m:math>&#160;of variables, <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>1</m:mn><m:mo>&#8804;</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>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="LSFUN2" id="LSFUN2"/>3: &#160;&#160;&#8194; LSFUN2 &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext">You must supply this routine to calculate the vector of values <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and the Jacobian matrix of first derivatives <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac>
</m:math>&#160;at any point <m:math><m:mi>x</m:mi></m:math>.  It should be tested separately before being used in conjunction with E04GZF.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#LSFUN2">LSFUN2</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;LSFUN2&#160;(</td><td class="tdfspec2"><a class="arg" href="../E04/e04gzf.xml#LSFUN2_M">M</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_N">N</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_XC">XC</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_FVEC">FVEC</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_FJAC">FJAC</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_LDFJAC">LDFJAC</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_IUSER">IUSER</a>, <a class="arg" href="../E04/e04gzf.xml#LSFUN2_RUSER">RUSER</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">M, N, LDFJAC, IUSER(*)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">XC(N), FVEC(M), FJAC(LDFJAC,N), RUSER(*)</td></tr></table>
<div class="paramtext">Important: the dimension declaration for <a class="arg" href="../E04/e04gzf.xml#LSFUN2_FJAC">FJAC</a> must contain the variable <a class="arg" href="../E04/e04gzf.xml#LSFUN2_LDFJAC">LDFJAC</a>, not an integer constant.</div>
<dl><dt class="paramhead"><a name="LSFUN2_M" id="LSFUN2_M"/>1: &#160;&#160;&#8194; M &#8211; INTEGER<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="LSFUN2_N" id="LSFUN2_N"/>2: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the numbers <m:math><m:mi>m</m:mi></m:math>&#160;and <m:math><m:mi>n</m:mi></m:math>&#160;of residuals and variables, respectively.</div></dd><dt class="paramhead"><a name="LSFUN2_XC" id="LSFUN2_XC"/>3: &#160;&#160;&#8194; XC(<a class="arg" href="../E04/e04gzf.xml#LSFUN2_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 values of the <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;and the <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac>
</m:math>&#160;are required.</div></dd><dt class="paramhead"><a name="LSFUN2_FVEC" id="LSFUN2_FVEC"/>4: &#160;&#160;&#8194; FVEC(<a class="arg" href="../E04/e04gzf.xml#LSFUN2_M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LSFUN2_FVEC"><m:mi mathcolor="#EE0000" mathvariant="bold">FVEC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;must be set to the value of <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;at the point <m:math><m:mi>x</m:mi></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>m</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="LSFUN2_FJAC" id="LSFUN2_FJAC"/>5: &#160;&#160;&#8194; FJAC(<a class="arg" href="../E04/e04gzf.xml#LSFUN2_LDFJAC">LDFJAC</a>,<a class="arg" href="../E04/e04gzf.xml#LSFUN2_N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LSFUN2_FJAC"><m:mi mathcolor="#EE0000" mathvariant="bold">FJAC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;must be set to the value of <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac>
</m:math>&#160;at the point <m:math><m:mi>x</m:mi></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>m</m:mi></m:math>&#160;and <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></dd><dt class="paramhead"><a name="LSFUN2_LDFJAC" id="LSFUN2_LDFJAC"/>6: &#160;&#160;&#8194; LDFJAC &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="../E04/e04gzf.xml#LSFUN2_FJAC">FJAC</a> as declared in the (sub)program from which E04GZF is called.</div></dd><dt class="paramhead"><a name="LSFUN2_IUSER" id="LSFUN2_IUSER"/>7: &#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="LSFUN2_RUSER" id="LSFUN2_RUSER"/>8: &#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="#LSFUN2">LSFUN2</a> is called from E04GZF with the parameters <a class="arg" href="../E04/e04gzf.xml#LSFUN2_IUSER">IUSER</a> and <a class="arg" href="../E04/e04gzf.xml#LSFUN2_RUSER">RUSER</a> as supplied to E04GZF.  You are free to use the arrays <a class="arg" href="../E04/e04gzf.xml#LSFUN2_IUSER">IUSER</a> and <a class="arg" href="../E04/e04gzf.xml#LSFUN2_RUSER">RUSER</a> to supply information to <a class="arg" href="#LSFUN2">LSFUN2</a> as an alternative to using 
COMMON. 

</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#LSFUN2">LSFUN2</a> must be declared as EXTERNAL in the (sub)program from which E04GZF 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="X" id="X"/>4: &#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 a guess at 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>.  The routine checks the first derivatives calculated by <a class="arg" href="#LSFUN2">LSFUN2</a> at the starting point and so is more likely to detect any error in your routines if the initial <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;are nonzero and mutually distinct.</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="FSUMSQ" id="FSUMSQ"/>5: &#160;&#160;&#8194; FSUMSQ &#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 sum of squares, <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, corresponding to the final point stored in <a class="arg" href="#X">X</a>.</div></dd><dt class="paramhead"><a name="W" id="W"/>6: &#160;&#160;&#8194; W(<a class="arg" href="#LW">LW</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Workspace</span></dt><dt class="multi-paramhead"><a name="LW" id="LW"/>7: &#160;&#160;&#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 E04GZF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <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>&gt;</m:mo><m:mn>1</m:mn></m:math>, <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:mn>8</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: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>&#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:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><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>3</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>;</li>
<li class="listcons">if <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>=</m:mo><m:mn>1</m:mn></m:math>, <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:mn>11</m:mn><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="IUSER" id="IUSER"/>8: &#160;&#160;&#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 E04GZF, but is passed directly to <a class="arg" href="#LSFUN2">LSFUN2</a> and may be used to pass information to that routine.</div></dd><dt class="paramhead"><a name="RUSER" id="RUSER"/>9: &#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"><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 E04GZF, but is passed directly to <a class="arg" href="#LSFUN2">LSFUN2</a> and may be used to pass information to that routine.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>10: &#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> E04GZF 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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</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: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:mn>8</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: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>&#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:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><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>3</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>, when <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>&gt;</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="#LW"><m:mi mathcolor="#EE0000" mathvariant="bold">LW</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>11</m:mn><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>, when <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>=</m:mo><m:mn>1</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">There have been <m:math><m:mn>50</m:mn><m:mo>&#215;</m:mo><m:mi>n</m:mi></m:math>&#160;calls of <a class="arg" href="#LSFUN2">LSFUN2</a>, yet the algorithm does not seem to have converged.  This may be due to an awkward function or to a poor starting point, so it is worth restarting E04GZF  from the final point held in <a class="arg" href="#X">X</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">
The final point does not satisfy the conditions for acceptance as a minimum, but no lower point could be found.</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 auxiliary routine has been unable to complete a singular value decomposition in a reasonable number of sub-iterations.</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  E04GZF is a minimum of <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.  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>, 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">
It is very likely that you have made an error in forming the derivatives <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac>
</m:math>&#160;in <a class="arg" href="#LSFUN2">LSFUN2</a>.</div>
</dd>
</dl>
<div class="paramtext">If you are not satisfied with the result (e.g., because <a class="arg" href="#IFAIL">IFAIL</a> lies between <m:math><m:mn>3</m:mn></m:math>&#160;and <m:math><m:mn>8</m:mn></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.  Repeated failure may indicate some defect in the formulation of the problem.</div><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">If the problem is reasonably well scaled and 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 the components of <m:math><m:mi>x</m:mi></m:math>&#160;and between <m:math><m:mi>t</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:math>&#160;(if  <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is of order <m:math><m:mn>1</m:mn></m:math>&#160;at the minimum) and <m:math><m:mn>2</m:mn><m:mi>t</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:math>&#160;(if <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is close to zero at the minimum) decimals accuracy in <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.</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 number of residuals and their behaviour, and the distance of the starting point from the solution.  The number of multiplications performed per iteration of E04GZF varies, but for <m:math><m:mi>m</m:mi><m:mo>&#8811;</m:mo><m:mi>n</m:mi></m:math>&#160;is approximately <m:math><m:mi>n</m:mi><m:mo>&#215;</m:mo><m:msup><m:mi>m</m:mi><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mrow><m:mi mathvariant="italic">O</m:mi><m:mfenced separators=""><m:msup><m:mi>n</m:mi><m:mn>3</m:mn></m:msup></m:mfenced></m:mrow></m:math>.  In addition,  each iteration makes at least one call of <a class="arg" href="#LSFUN2">LSFUN2</a>.  So, unless the residuals and their derivatives can be evaluated very quickly, the run time will be dominated by the time spent in <a class="arg" href="#LSFUN2">LSFUN2</a>.</div><div class="paramtext">Ideally, the problem should be scaled so that the minimum value of the sum of squares is in the range <m:math><m:mfenced separators=""><m:mn>0</m:mn><m:mo>,</m:mo><m:mrow><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:math>&#160;and so that at points a unit distance away from the solution the sum of squares 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 E04GZF  will take less computer time.</div><div class="paramtext">When the sum of squares represents the goodness-of-fit of a nonlinear model to observed data, elements of the variance-covariance matrix of the estimated regression coefficients can be computed by a subsequent call to <a class="rout" href="../E04/e04ycf.xml">E04YCF</a>, using information returned in segments of the workspace array <a class="arg" href="#W">W</a>.  See <a class="rout" href="../E04/e04ycf.xml">E04YCF</a> for further details.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example finds least-squares estimates of <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub></m:math>&#160;in the model

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>y</m:mi><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>+</m:mo><m:mfrac><m:msub><m:mi>t</m:mi><m:mn>1</m:mn></m:msub><m:mrow><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:msub><m:mi>t</m:mi><m:mn>2</m:mn></m:msub><m:mo>+</m:mo><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub><m:msub><m:mi>t</m:mi><m:mn>3</m:mn></m:msub></m:mrow>
 </m:mfrac>
</m:math></td><td class="formula2"/></tr></table></div>

using the <m:math><m:mn>15</m:mn></m:math>&#160;sets of data given in the following table.

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable columnalign="right">
 <m:mtr>
  <m:mtd><m:mi>y</m:mi></m:mtd>
  <m:mtd><m:msub><m:mi>t</m:mi><m:mn>1</m:mn></m:msub></m:mtd>
  <m:mtd><m:msub><m:mi>t</m:mi><m:mn>2</m:mn></m:msub></m:mtd>
  <m:mtd><m:msub><m:mi>t</m:mi><m:mn>3</m:mn></m:msub></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.14</m:mn></m:mtd>
  <m:mtd><m:mn>1.0</m:mn></m:mtd>
  <m:mtd><m:mn>15.0</m:mn></m:mtd>
  <m:mtd><m:mn>1.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.18</m:mn></m:mtd>
  <m:mtd><m:mn>2.0</m:mn></m:mtd>
  <m:mtd><m:mn>14.0</m:mn></m:mtd>
  <m:mtd><m:mn>2.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.22</m:mn></m:mtd>
  <m:mtd><m:mn>3.0</m:mn></m:mtd>
  <m:mtd><m:mn>13.0</m:mn></m:mtd>
  <m:mtd><m:mn>3.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.25</m:mn></m:mtd>
  <m:mtd><m:mn>4.0</m:mn></m:mtd>
  <m:mtd><m:mn>12.0</m:mn></m:mtd>
  <m:mtd><m:mn>4.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.29</m:mn></m:mtd>
  <m:mtd><m:mn>5.0</m:mn></m:mtd>
  <m:mtd><m:mn>11.0</m:mn></m:mtd>
  <m:mtd><m:mn>5.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.32</m:mn></m:mtd>
  <m:mtd><m:mn>6.0</m:mn></m:mtd>
  <m:mtd><m:mn>10.0</m:mn></m:mtd>
  <m:mtd><m:mn>6.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.35</m:mn></m:mtd>
  <m:mtd><m:mn>7.0</m:mn></m:mtd>
  <m:mtd><m:mn>9.0</m:mn></m:mtd>
  <m:mtd><m:mn>7.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.39</m:mn></m:mtd>
  <m:mtd><m:mn>8.0</m:mn></m:mtd>
  <m:mtd><m:mn>8.0</m:mn></m:mtd>
  <m:mtd><m:mn>8.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.37</m:mn></m:mtd>
  <m:mtd><m:mn>9.0</m:mn></m:mtd>
  <m:mtd><m:mn>7.0</m:mn></m:mtd>
  <m:mtd><m:mn>7.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.58</m:mn></m:mtd>
  <m:mtd><m:mn>10.0</m:mn></m:mtd>
  <m:mtd><m:mn>6.0</m:mn></m:mtd>
  <m:mtd><m:mn>6.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.73</m:mn></m:mtd>
  <m:mtd><m:mn>11.0</m:mn></m:mtd>
  <m:mtd><m:mn>5.0</m:mn></m:mtd>
  <m:mtd><m:mn>5.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>0.96</m:mn></m:mtd>
  <m:mtd><m:mn>12.0</m:mn></m:mtd>
  <m:mtd><m:mn>4.0</m:mn></m:mtd>
  <m:mtd><m:mn>4.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>1.34</m:mn></m:mtd>
  <m:mtd><m:mn>13.0</m:mn></m:mtd>
  <m:mtd><m:mn>3.0</m:mn></m:mtd>
  <m:mtd><m:mn>3.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>2.10</m:mn></m:mtd>
  <m:mtd><m:mn>14.0</m:mn></m:mtd>
  <m:mtd><m:mn>2.0</m:mn></m:mtd>
  <m:mtd><m:mn>2.0</m:mn></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mn>4.39</m:mn></m:mtd>
  <m:mtd><m:mn>15.0</m:mn></m:mtd>
  <m:mtd><m:mn>1.0</m:mn></m:mtd>
  <m:mtd><m:mn>1.0</m:mn></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

The program uses <m:math><m:mfenced separators=""><m:mn>0.5</m:mn><m:mo>,</m:mo><m:mn>1.0</m:mn><m:mo>,</m:mo><m:mn>1.5</m:mn></m:mfenced></m:math>&#160;as the initial guess at the position of the minimum.</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/e04gzfe.f">Program Text (e04gzfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<p><a class="verbatimref" href="../../examples/data/e04gzfe.d">Program&#160;Data (e04gzfe.d)</a></p><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/e04gzfe.r">Program Results (e04gzfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/E04/e04gzf.pdf">E04GZF (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>
