<?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>E01AEF : 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/E01/e01aef.pdf">E01AEF (PDF version)</a></div><div><a class="chap" href="e01conts.xml">E01 Chapter Contents</a></div><div><a class="chapint" href="e01intro.xml">E01 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/>E01AEF</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="htmltoc" onclick="showLevel('tocfcomments');"><span class="htmltocplus" id="tocfcommentsplus">+</span><span class="htmltocminus" id="tocfcommentsminus">&#8722;</span></span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
<div class="htmltocitem" id="tocfcomments">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments1">8.1&#160;&#160;<b>Timing</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments2">8.2&#160;&#160;<b>Divided-difference Strategy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments3">8.3&#160;&#160;<b>Conversion to Chebyshev Form</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments4">8.4&#160;&#160;<b>Iterative Refinement</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments5">8.5&#160;&#160;<b>Workspace Information</b></a>
</div>
</div>
</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">E01AEF constructs the Chebyshev series representation of a polynomial interpolant to a set of data which may contain derivative values.</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;E01AEF&#160;(</td><td class="tdfspec2"><a class="arg" href="#M">M</a>, <a class="arg" href="#XMIN">XMIN</a>, <a class="arg" href="#XMAX">XMAX</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#IP">IP</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#ITMIN">ITMIN</a>, <a class="arg" href="#ITMAX">ITMAX</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#WRK">WRK</a>, <a class="arg" href="#LWRK">LWRK</a>, <a class="arg" href="#IWRK">IWRK</a>, <a class="arg" href="#LIWRK">LIWRK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">M, IP(M), N, ITMIN, ITMAX, LWRK, IWRK(LIWRK), LIWRK, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">XMIN, XMAX, X(M), Y(N), A(N), WRK(LWRK)</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">Let <m:math><m:mi>m</m:mi></m:math>&#160;distinct values <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;of an independent variable <m:math><m:mi>x</m:mi></m:math>&#160;be given, with <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi></m:math>.  For each value <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, suppose that the value <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;of the dependent variable <m:math><m:mi>y</m:mi></m:math>&#160;together with the first <m:math><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;derivatives of <m:math><m:mi>y</m:mi></m:math>&#160;with respect to <m:math><m:mi>x</m:mi></m:math>&#160;are given.  Each <m:math><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;must therefore be a non-negative integer, with the total number of interpolating conditions, <m:math><m:mi>n</m:mi></m:math>, equal to <m:math><m:mi>m</m:mi><m:mo>+</m:mo><m:mstyle displaystyle="true"><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:mstyle><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div><div class="paramtext">E01AEF calculates the unique polynomial <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;of degree <m:math><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:math>&#160;(or less) which is such that <m:math><m:msup><m:mi>q</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>=</m:mo><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msubsup></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>k</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>.  Here <m:math><m:msup><m:mi>q</m:mi>
<m:mfenced separators=""><m:mn>0</m:mn></m:mfenced>
</m:msup><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;means <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>.  This polynomial is represented in Chebyshev series form in the normalized variable <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>, as follows:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mfrac other="small"><m:mn>1</m:mn><m:mn>2</m:mn></m:mfrac><m:msub><m:mi>a</m:mi><m:mn>0</m:mn></m:msub><m:msub><m:mi>T</m:mi><m:mn>0</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mo>+</m:mo><m:msub><m:mi>a</m:mi><m:mn>1</m:mn></m:msub><m:msub><m:mi>T</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mo>+</m:mo><m:mo>&#8943;</m:mo><m:mo>+</m:mo><m:msub><m:mi>a</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:msub><m:mi>T</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover><m:mo>=</m:mo><m:mfrac><m:mrow><m:mn>2</m:mn><m:mi>x</m:mi><m:mo>-</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub><m:mo>-</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub></m:mrow>
  <m:mrow><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub><m:mo>-</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub></m:mrow>
 </m:mfrac>
</m:math></td><td class="formula2"/></tr></table></div>

so that <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mo>&#8804;</m:mo><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover><m:mo>&#8804;</m:mo><m:mn>1</m:mn></m:math>&#160;for <m:math><m:mi>x</m:mi></m:math>&#160;in the interval <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub></m:math>&#160;to <m:math><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub></m:math>, and where <m:math><m:msub><m:mi>T</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced></m:math>&#160;is the Chebyshev polynomial of the first kind of degree <m:math><m:mi>i</m:mi></m:math>&#160;with argument <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>.</div><div class="paramtext">(The polynomial interpolant can subsequently be evaluated for any value of <m:math><m:mi>x</m:mi></m:math>&#160;in the given range by using <a class="rout" href="../E02/e02akf.xml">E02AKF</a>.  Chebyshev series representations of the derivative(s) and integral(s) of <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;may be obtained by (repeated) use of <a class="rout" href="../E02/e02ahf.xml">E02AHF</a> and <a class="rout" href="../E02/e02ajf.xml">E02AJF</a>.)</div><div class="paramtext">The method used consists first of constructing a divided-difference table from the normalized <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>&#160;values and the given values of <m:math><m:mi>y</m:mi></m:math>&#160;and its derivatives with respect to <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>.  The Newton form of <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is then obtained from this table, as described in <a class="ref" href="#ref319">Huddleston (1974)</a> and <a class="ref" href="#ref320">Krogh (1970)</a>, with the modification described in <a class="sec" href="#fcomments2">Section 8.2</a>.  The Newton form of the polynomial is then converted to Chebyshev series form as described in <a class="sec" href="#fcomments3">Section 8.3</a>.</div><div class="paramtext">Since the errors incurred by these stages can be considerable, a form of iterative refinement is used to improve the solution.  This refinement is particularly useful when derivatives of rather high order are given in the data.  In reasonable examples, the refinement will usually terminate with a certain accuracy criterion satisfied by the polynomial (see <a class="sec" href="#accuracy">Section 7</a>).  In more difficult examples, the criterion may not be satisfied and refinement will continue until the maximum number of iterations (as specified by the input parameter <a class="arg" href="#ITMAX">ITMAX</a>) is reached.</div><div class="paramtext">In extreme examples, the iterative process may diverge (even though the accuracy criterion is satisfied): if a certain divergence criterion is satisfied, the process terminates at once.  In all cases the routine returns the &#8216;best&#8217; polynomial achieved before termination.  For the definition of &#8216;best&#8217; and details of iterative refinement and termination criteria, see <a class="sec" href="#fcomments4">Section 8.4</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref319" id="ref319"/>Huddleston R E (1974)  CDC 6600 routines for the interpolation of data and of data with derivatives <i>SLL-74-0214</i> Sandia Laboratories (Reprint) </div>
<div class="paramtext"><a name="ref320" id="ref320"/>Krogh F T (1970)  Efficient algorithms for polynomial interpolation and numerical differentiation <i>Math. Comput.</i> <b>24</b> 185&#8211;190 </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><dd><div class="paramtext"><i>On entry</i>: 

<m:math><m:mi>m</m:mi></m:math>, the number of given values of the independent variable <m:math><m:mi>x</m:mi></m:math>.</div><div class="paramtext"><i>Constraint</i>:
  <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>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="XMIN" id="XMIN"/>2: &#160;&#160;&#8194; XMIN &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="XMAX" id="XMAX"/>3: &#160;&#160;&#8194; XMAX &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the lower and upper end points, respectively, of the interval <m:math><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub></m:mfenced></m:math>. If they are not determined by your problem, it is recommended that they be set respectively to the smallest and largest values among the <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMIN"><m:mi mathcolor="#EE0000" mathvariant="bold">XMIN</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">XMAX</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="X" id="X"/>4: &#160;&#160;&#8194; X(<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>:   the value of <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi></m:math>. The <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:math>&#160;need not be ordered.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMIN"><m:mi mathcolor="#EE0000" mathvariant="bold">XMIN</m:mi></m:maction><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:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">XMAX</m:mi></m:maction></m:math>, and the <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:math>&#160;must be distinct.
</div></dd><dt class="paramhead"><a name="Y" id="Y"/>5: &#160;&#160;&#8194; Y(<a class="arg" href="#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 given values of the dependent variable, and derivatives, as follows:
<div class="paramtext">The first <m:math><m:msub><m:mi>p</m:mi><m:mn>1</m:mn></m:msub><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;elements contain <m:math><m:msub><m:mi>y</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mn>1</m:mn> <m:mfenced separators=""><m:mn>1</m:mn></m:mfenced> </m:msubsup><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mn>1</m:mn> <m:mfenced separators=""><m:msub><m:mi>p</m:mi><m:mn>1</m:mn></m:msub></m:mfenced> </m:msubsup></m:math>&#160;in that order.</div>
<div class="paramtext">The next <m:math><m:msub><m:mi>p</m:mi><m:mn>2</m:mn></m:msub><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;elements contain <m:math><m:msub><m:mi>y</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mn>2</m:mn> <m:mfenced separators=""><m:mn>1</m:mn></m:mfenced> </m:msubsup><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mn>2</m:mn> <m:mfenced separators=""><m:msub><m:mi>p</m:mi><m:mn>2</m:mn></m:msub></m:mfenced> </m:msubsup></m:math>&#160;in that order.</div>
<div class="paramtext"><m:math><m:mtext>&#8195;</m:mtext><m:mo>&#8942;</m:mo></m:math></div>
<div class="paramtext">The last <m:math><m:msub><m:mi>p</m:mi><m:mi>m</m:mi></m:msub><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;elements contain <m:math><m:msub><m:mi>y</m:mi><m:mi>m</m:mi></m:msub><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mi>m</m:mi> <m:mfenced separators=""><m:mn>1</m:mn></m:mfenced> </m:msubsup><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msubsup><m:mi>y</m:mi><m:mi>m</m:mi> <m:mfenced separators=""><m:msub><m:mi>p</m:mi><m:mi>m</m:mi></m:msub></m:mfenced> </m:msubsup></m:math>&#160;in that order.</div>
</div></dd><dt class="paramhead"><a name="IP" id="IP"/>6: &#160;&#160;&#8194; IP(<a class="arg" href="#M">M</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>:   <m:math><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>, the order of the highest-order derivative whose value is given at <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi></m:math>. If the value of <m:math><m:mi>y</m:mi></m:math>&#160;only is given for some <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;then the corresponding value of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;must be zero.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi mathvariant="italic">i</m:mi></m:mfenced></m:mrow><m:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>,  for <m:math><m:mi mathvariant="italic">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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="N" id="N"/>7: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 

<m:math><m:mi>n</m:mi></m:math>, the total number of interpolating conditions.</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>=</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>+</m:mo><m:mstyle displaystyle="true"><m:munderover><m:mo>&#8721;</m:mo>
<m:mrow><m:mi mathvariant="italic">i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow>
<m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction>
</m:munderover></m:mstyle>
<m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi mathvariant="italic">i</m:mi></m:mfenced></m:mrow> </m:math>.
</div></dd><dt class="paramhead"><a name="ITMIN" id="ITMIN"/>8: &#160;&#160;&#8194; ITMIN &#8211; INTEGER<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="ITMAX" id="ITMAX"/>9: &#160;&#160;&#8194; ITMAX &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: respectively the minimum and maximum number of iterations to be performed by the routine (for full details see <a class="sec" href="#fcomments4">Section 8.4</a>). Setting <a class="arg" href="#ITMIN">ITMIN</a> and/or <a class="arg" href="#ITMAX">ITMAX</a> negative or zero invokes default value(s) of <m:math><m:mn>2</m:mn></m:math>&#160;and/or <m:math><m:mn>10</m:mn></m:math>, respectively.
<div class="paramtext">The default values will be satisfactory for most problems, but occasionally significant improvement will result from using higher values.</div>
</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITMIN"><m:mi mathcolor="#EE0000" mathvariant="bold">ITMIN</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">ITMAX</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>.

</div></dd><dt class="paramhead"><a name="A" id="A"/>10: &#8194; A(<a class="arg" href="#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="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>&#160;contains the coefficient <m:math><m:msub><m:mi>a</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;in the Chebyshev series representation of <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>.</div></dd><dt class="paramhead"><a name="WRK" id="WRK"/>11: &#8194; WRK(<a class="arg" href="#LWRK">LWRK</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: used as workspace, but see also <a class="sec" href="#fcomments5">Section 8.5</a>.</div></dd><dt class="paramhead"><a name="LWRK" id="LWRK"/>12: &#8194; LWRK &#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="#WRK">WRK</a> as declared in the (sub)program from which E01AEF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LWRK</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>7</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>5</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="italic">ipmax</m:mi><m:mo>+</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>+</m:mo><m:mn>7</m:mn> </m:math>, where <m:math><m:mi mathvariant="italic">ipmax</m:mi></m:math>&#160;is the largest element of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="IWRK" id="IWRK"/>13: &#8194; IWRK(<a class="arg" href="#LIWRK">LIWRK</a>) &#8211; INTEGER array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: used as workspace, but see also <a class="sec" href="#fcomments5">Section 8.5</a>.</div></dd><dt class="paramhead"><a name="LIWRK" id="LIWRK"/>14: &#8194; LIWRK &#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="#IWRK">IWRK</a> as declared in the (sub)program from which E01AEF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LIWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LIWRK</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>15: &#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, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></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 mathvariant="bold">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">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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</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="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8800;</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>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mo>&#8943;</m:mo><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></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="#LWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LWRK</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>7</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>5</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="italic">ipmax</m:mi><m:mo>+</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>+</m:mo><m:mn>7</m:mn></m:math>&#160;(see <a class="arg" href="#LWRK">LWRK</a> for the definition of <m:math><m:mi mathvariant="italic">ipmax</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="#LIWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LIWRK</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IP"><m:mi mathcolor="#EE0000" mathvariant="bold">IP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>&#160;for some <m:math><m:mi>i</m:mi></m:math>.</td></tr></table>
</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>
<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="#XMIN"><m:mi mathcolor="#EE0000" mathvariant="bold">XMIN</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">XMAX</m:mi></m:maction></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><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>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMIN"><m:mi mathcolor="#EE0000" mathvariant="bold">XMIN</m:mi></m:maction></m:math>&#160;for some <m:math><m:mi>i</m:mi></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><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>&gt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#XMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">XMAX</m:mi></m:maction></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><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="#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;for some <m:math><m:mi>i</m:mi><m:mo>&#8800;</m:mo><m:mi>j</m:mi></m:math>.</td></tr></table>
</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">Not all the performance indices are less than eight times the <span class="bitalic">machine precision</span>, although <a class="arg" href="#ITMAX">ITMAX</a> iterations have been performed.  Parameters <a class="arg" href="#A">A</a>, <a class="arg" href="#WRK">WRK</a> and <a class="arg" href="#IWRK">IWRK</a> relate to the best polynomial determined.  A more accurate solution may possibly be obtained by increasing <a class="arg" href="#ITMAX">ITMAX</a> and recalling the routine.  See also <a class="sec" href="#accuracy">Sections 7</a>, <a class="sec" href="#fcomments4">8.4</a> and <a class="sec" href="#fcomments5">8.5</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>
<dd>
<div class="paramtext">The computation has been terminated because the iterative process appears to be diverging.  (Parameters <a class="arg" href="#A">A</a>, <a class="arg" href="#WRK">WRK</a> and <a class="arg" href="#IWRK">IWRK</a> relate to the best polynomial determined.)  Thus the problem specified by your data is probably too ill-conditioned for the solution to be satisfactory.  This may result from some of the <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:math>&#160;being very close together, or from the number of interpolating conditions, <a class="arg" href="#N">N</a>, being large.  If in such cases the conditions do not involve derivatives, you are likely to obtain a much more satisfactory solution to your problem either by cubic spline interpolation (see <a class="rout" href="../E01/e01baf.xml">E01BAF</a>) or by curve-fitting with a polynomial or spline in which the number of coefficients is less than <a class="arg" href="#N">N</a>, preferably much less if <a class="arg" href="#N">N</a> is large (see <a class="chap" href="../E02/e02conts.xml">Chapter E02</a>).  But see <a class="sec" href="#accuracy">Sections 7</a>, <a class="sec" href="#fcomments4">8.4</a> and <a class="sec" href="#fcomments5">8.5</a>.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">A complete error analysis is not currently available, but the method gives good results for reasonable problems.</div><div class="paramtext">It is important to realise that for some sets of data, the polynomial interpolation problem is <b>ill-conditioned</b>.  That is, a <b>small</b> perturbation in the data may induce <b>large</b> changes in the polynomial, <b>even in exact arithmetic</b>.  Though by no means the worst example, interpolation by a single polynomial to a large number of function values given at points equally spaced across the range is notoriously ill-conditioned and the polynomial interpolating such a dataset is prone to exhibit enormous oscillations between the data points, especially near the ends of the range.  These will be reflected in the Chebyshev coefficients being large compared with the given function values.  A more familiar example of ill-conditioning occurs in the solution of certain systems of linear algebraic equations, in which a small change in the elements of the matrix and/or in the components of the right-hand side vector induces a relatively large change in the solution vector.  The best that can be achieved in these cases is to make the residual vector small in some sense.  If this is possible, the computed solution is exact for a slightly perturbed set of data.  Similar considerations apply to the interpolation problem.</div><div class="paramtext">The residuals <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msubsup><m:mo>-</m:mo><m:msup><m:mi>q</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;are available for inspection
(see <a class="sec" href="#fcomments5">Section 8.5</a>).
To assess whether these are reasonable, however, it is necessary to relate them to the largest function and derivative values taken by <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;over the interval <m:math><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub></m:mfenced></m:math>.  The following performance indices aim to do this.  Let the <m:math><m:mi>k</m:mi></m:math>th derivative of <m:math><m:mi>q</m:mi></m:math>&#160;with respect to the normalized variable <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>&#160;be given by the Chebyshev series

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfrac other="small"><m:mn>1</m:mn><m:mn>2</m:mn></m:mfrac><m:msubsup><m:mi>a</m:mi><m:mn>0</m:mn><m:mi>k</m:mi></m:msubsup><m:msub><m:mi>T</m:mi><m:mn>0</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mo>+</m:mo><m:msubsup><m:mi>a</m:mi><m:mn>1</m:mn><m:mi>k</m:mi></m:msubsup><m:msub><m:mi>T</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mo>+</m:mo><m:mo>&#8943;</m:mo><m:mo>+</m:mo><m:msubsup><m:mi>a</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn><m:mo>-</m:mo><m:mi>k</m:mi></m:mrow><m:mi>k</m:mi></m:msubsup><m:msub><m:mi>T</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn><m:mo>-</m:mo><m:mi>k</m:mi></m:mrow></m:msub><m:mfenced separators=""><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

Let <m:math><m:msub><m:mi>A</m:mi><m:mi>k</m:mi></m:msub></m:math>&#160;denote the sum of the moduli of these coefficients (this is an upper bound on the <m:math><m:mi>k</m:mi></m:math>th derivative in the interval and is taken as a measure of the maximum size of this derivative), and define

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msub><m:mi>S</m:mi><m:mi>k</m:mi></m:msub>
 <m:mo>=</m:mo>
 <m:munder>
  <m:mi mathvariant="normal">max</m:mi>
  <m:mrow><m:mi>i</m:mi><m:mo>&#8804;</m:mo><m:mi>k</m:mi></m:mrow>
 </m:munder><m:mspace width="0.25em"/>
 <m:msub><m:mi>A</m:mi><m:mi>i</m:mi></m:msub>
 <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

Then if the root-mean-square value of the residuals of <m:math><m:msup><m:mi>q</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup></m:math>, scaled so as to relate to the normalized variable <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>, is denoted by <m:math><m:msub><m:mi>r</m:mi><m:mi>k</m:mi></m:msub></m:math>, the performance indices are defined by

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>P</m:mi><m:mi>k</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>r</m:mi><m:mi>k</m:mi></m:msub><m:mo>/</m:mo><m:msub><m:mi>S</m:mi><m:mi>k</m:mi></m:msub><m:mtext>, &#8195; for &#8203;</m:mtext><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:munder><m:mi mathvariant="normal">max</m:mi><m:mi>i</m:mi></m:munder><m:mspace width="0.25em"/><m:mfenced separators=""><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

It is expected that, in reasonable cases, they will all be less than (say) <m:math><m:mn>8</m:mn></m:math>&#160;times the <span class="bitalic">machine precision</span> (this is the accuracy criterion mentioned in <a class="sec" href="#description">Section 3</a>), and in many cases will be of the order of <span class="bitalic">machine precision</span> or less.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2><h3 class="standard"><a class="sec" name="fcomments1" id="fcomments1"/>8.1&#160;&#160;Timing</h3>
<div class="paramtext">Computation time is approximately proportional to <m:math><m:mi mathvariant="italic">it</m:mi><m:mo>&#215;</m:mo><m:msup><m:mi>n</m:mi><m:mn>3</m:mn></m:msup></m:math>, where <m:math><m:mi mathvariant="italic">it</m:mi></m:math>&#160;is the number of iterations actually used.
(See <a class="sec" href="#fcomments5">Section 8.5</a>.)
</div><h3 class="standard"><a class="sec" name="fcomments2" id="fcomments2"/>8.2&#160;&#160;Divided-difference Strategy</h3>
<div class="paramtext">In constructing each new coefficient in the Newton form of the polynomial, a new <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;must be brought into the computation.  The <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;chosen is that which yields the smallest new coefficient.  This strategy increases the stability of the divided-difference technique, sometimes quite markedly, by reducing errors due to cancellation.</div><h3 class="standard"><a class="sec" name="fcomments3" id="fcomments3"/>8.3&#160;&#160;Conversion to Chebyshev Form</h3>
<div class="paramtext">Conversion from the Newton form to Chebyshev series form is effected by evaluating the former at the <m:math><m:mi>n</m:mi></m:math>&#160;values of <m:math><m:mover><m:mi>x</m:mi><m:mo>-</m:mo></m:mover></m:math>&#160;at which <m:math><m:msub><m:mi>T</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;takes the value <m:math><m:mrow><m:mo>&#177;</m:mo><m:mn>1</m:mn></m:mrow></m:math>, and then interpolating these <m:math><m:mi>n</m:mi></m:math>&#160;function values by a call of <a class="rout" href="../E02/e02aff.xml">E02AFF</a>, which provides the Chebyshev series representation of the polynomial with very small additional relative error.</div><h3 class="standard"><a class="sec" name="fcomments4" id="fcomments4"/>8.4&#160;&#160;Iterative Refinement</h3>
<div class="paramtext">The iterative refinement process is performed as follows.</div><div class="paramtext">Firstly, an initial approximation, <m:math><m:msub><m:mi>q</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;say, is found by the technique described in <a class="sec" href="#description">Section 3</a>.  The <m:math><m:mi>r</m:mi></m:math>th step of the refinement process then consists of evaluating the residuals of the <m:math><m:mi>r</m:mi></m:math>th approximation <m:math><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, and constructing an interpolant, <m:math><m:mrow><m:mi>d</m:mi><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub></m:mrow><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, to these residuals.  The next approximation <m:math><m:msub><m:mi>q</m:mi><m:mrow><m:mi>r</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;to the interpolating polynomial is then obtained as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>q</m:mi><m:mrow><m:mi>r</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>+</m:mo><m:mrow><m:mi>d</m:mi><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub></m:mrow><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

This completes the description of the <m:math><m:mi>r</m:mi></m:math>th step.</div><div class="paramtext">The iterative process is terminated according to the following criteria.  When a polynomial is found whose performance indices (as defined in <a class="sec" href="#accuracy">Section 7</a>) are all less than <m:math><m:mn>8</m:mn></m:math>&#160;times the <span class="bitalic">machine precision</span>, the process terminates after <a class="arg" href="#ITMIN">ITMIN</a> further iterations (or after a total of <a class="arg" href="#ITMAX">ITMAX</a> iterations if that occurs earlier).  This will occur in most reasonable problems.  The extra iterations are to allow for the possibility of further improvement.  If no such polynomial is found, the process terminates after a total of <a class="arg" href="#ITMAX">ITMAX</a> iterations.  Both these criteria are over-ridden, however, in two special cases.  Firstly, if for some value of <m:math><m:mi>r</m:mi></m:math>&#160;the sum of the moduli of the Chebyshev coefficients of <m:math><m:mrow><m:mi>d</m:mi><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub></m:mrow><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is greater than that of <m:math><m:msub><m:mi>q</m:mi><m:mi>r</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, it is concluded that the process is diverging and the process is terminated at once (<m:math><m:msub><m:mi>q</m:mi><m:mrow><m:mi>r</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is not computed).</div><div class="paramtext">Secondly, if at any stage, the performance indices are all computed as zero, again the process is terminated at once.</div><div class="paramtext">As the iterations proceed, a record is kept of the best polynomial.  Subsequently, at the end of each iteration, the new polynomial replaces the current best polynomial if it satisfies two conditions (otherwise the best polynomial remains unchanged).  The first condition is that at least one of its root-mean-square residual values, <m:math><m:msub><m:mi>r</m:mi><m:mi>k</m:mi></m:msub></m:math>&#160;(see <a class="sec" href="#accuracy">Section 7</a>) is smaller than the corresponding value for the current best polynomial.  The second condition takes two different forms according to whether or not the performance indices (see <a class="sec" href="#accuracy">Section 7</a>) of the current best polynomial are all less than <m:math><m:mn>8</m:mn></m:math>&#160;times the <span class="bitalic">machine precision</span>.  If they are, then the largest performance index of the new polynomial is required to be less than that of the current best polynomial.  If they are not, the number of indices which are less than <m:math><m:mn>8</m:mn></m:math>&#160;times the <span class="bitalic">machine precision</span> must not be smaller than for the current best polynomial.  When the iterative process is terminated, it is the polynomial then recorded as best, which is returned to you as <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.</div><h3 class="standard"><a class="sec" name="fcomments5" id="fcomments5"/>8.5&#160;&#160;Workspace Information</h3>
<div class="paramtext">On successful exit, and also 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="#IFeq4"><m:mn mathcolor="#003399" mathvariant="bold">4</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>&#160;on exit, the following information is contained in the workspace arrays <a class="arg" href="#WRK">WRK</a> and <a class="arg" href="#IWRK">IWRK</a>:</div><div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WRK"><m:mi mathcolor="#EE0000" mathvariant="bold">WRK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi>k</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>, for <m:math><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi mathvariant="italic">ipmax</m:mi></m:math>&#160;where <m:math><m:mi mathvariant="italic">ipmax</m:mi><m:mo>=</m:mo><m:mstyle displaystyle="true"><m:munder><m:mi mathvariant="normal">max</m:mi><m:mi>i</m:mi></m:munder></m:mstyle><m:mspace width="0.25em"/><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:math>, contains the ratio of <m:math><m:msub><m:mi>p</m:mi><m:mi>k</m:mi></m:msub></m:math>, the performance index relating to the <m:math><m:mi>k</m:mi></m:math>th derivative of the <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;finally provided, to <m:math><m:mn>8</m:mn></m:math>&#160;times the <span class="bitalic">machine precision</span>.</div><div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WRK"><m:mi mathcolor="#EE0000" mathvariant="bold">WRK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi mathvariant="italic">ipmax</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>+</m:mo><m:mi>j</m:mi></m:mrow></m:mfenced></m:mrow></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>, contains the <m:math><m:mi>j</m:mi></m:math>th residual, i.e., the value of <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msubsup><m:mo>-</m:mo><m:msup><m:mi>q</m:mi>
<m:mfenced separators=""><m:mi>k</m:mi></m:mfenced>
</m:msup><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>, where <m:math><m:mi>i</m:mi></m:math>&#160;and <m:math><m:mi>k</m:mi></m:math>&#160;are the appropriate values corresponding to the <m:math><m:mi>j</m:mi></m:math>th element in the array <a class="arg" href="#Y">Y</a> (see the description of <a class="arg" href="#Y">Y</a> in <a class="sec" href="#parameters">Section 5</a>).</div><div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">IWRK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains the number of iterations actually performed in deriving <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.</div><div class="paramtext">If, on 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="#IFeq4"><m:mn mathcolor="#003399" mathvariant="bold">4</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 <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;finally provided may still be adequate for your requirements.  To assess this you should examine the residuals contained in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WRK"><m:mi mathcolor="#EE0000" mathvariant="bold">WRK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi mathvariant="italic">ipmax</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>+</m:mo><m:mi>j</m:mi></m:mrow></m:mfenced></m:mrow></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>, to see whether they are acceptably small.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example constructs an interpolant <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;to the following data:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable columnalign="right right right left left">
 <m:mtr>
  <m:mtd><m:mi>m</m:mi><m:mo>=</m:mo><m:mn>4</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">min</m:mi></m:msub><m:mo>=</m:mo><m:mn>2</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mi mathvariant="normal">max</m:mi></m:msub><m:mo>=</m:mo><m:mn>6</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd/>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mn>2</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>p</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>y</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mn>1</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd/>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mn>4</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>p</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mn>1</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>y</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mn>2</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msubsup><m:mi>y</m:mi><m:mn>2</m:mn>
<m:mfenced separators=""><m:mn>1</m:mn></m:mfenced>
</m:msubsup><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>,</m:mtext></m:mtd>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub><m:mo>=</m:mo><m:mn>5</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>p</m:mi><m:mn>3</m:mn></m:msub><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>y</m:mi><m:mn>3</m:mn></m:msub><m:mo>=</m:mo><m:mn>1</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd/>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd><m:msub><m:mi>x</m:mi><m:mn>4</m:mn></m:msub><m:mo>=</m:mo><m:mn>6</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>p</m:mi><m:mn>4</m:mn></m:msub><m:mo>=</m:mo><m:mn>2</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msub><m:mi>y</m:mi><m:mn>4</m:mn></m:msub><m:mo>=</m:mo><m:mn>2</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msubsup><m:mi>y</m:mi><m:mn>4</m:mn>
<m:mfenced separators=""><m:mn>1</m:mn></m:mfenced>
</m:msubsup><m:mo>=</m:mo><m:mn>4</m:mn><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:msubsup><m:mi>y</m:mi><m:mn>4</m:mn>
<m:mfenced separators=""><m:mn>2</m:mn></m:mfenced>
</m:msubsup><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow><m:mtext>.</m:mtext></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

The coefficients in the Chebyshev series representation of <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;are printed, and also the residuals corresponding to each of the given function and derivative values.</div><div class="paramtext">This program is written in a generalized form which can read any number of data-sets.</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/e01aefe.f">Program Text (e01aefe.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/e01aefe.d">Program&#160;Data (e01aefe.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/e01aefe.r">Program Results (e01aefe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/E01/e01aef.pdf">E01AEF (PDF version)</a></div><div><a class="chap" href="e01conts.xml">E01 Chapter Contents</a></div><div><a class="chapint" href="e01intro.xml">E01 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>
