<?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>C05BAF : 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/C05/c05baf.pdf">C05BAF (PDF version)</a></div><div><a class="chap" href="c05conts.xml">C05 Chapter Contents</a></div><div><a class="chapint" href="c05intro.xml">C05 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/>C05BAF</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">C05BAF returns the real values of Lambert's <m:math><m:mi>W</m:mi></m:math>&#160;function <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, via the routine name. </div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b>&#160;FUNCTION&#160;C05BAF&#160;(</td><td class="tdfspec2"><a class="arg" href="#X">X</a>, <a class="arg" href="#BRANCH">BRANCH</a>, <a class="arg" href="#OFFSET">OFFSET</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">BRANCH, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X</td></tr><tr><td class="tdfspec1">LOGICAL</td><td class="tdfspec2">OFFSET</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">C05BAF calculates an approximate value for the real branches of Lambert's <m:math><m:mi>W</m:mi></m:math>&#160;function (sometimes known as the &#8216;product log&#8217; or &#8216;Omega&#8217; function), which is the inverse function of 

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>f</m:mi><m:mfenced separators=""><m:mi>w</m:mi></m:mfenced>
 <m:mo>=</m:mo>
 <m:mi>w</m:mi><m:msup><m:mi>e</m:mi><m:mi>w</m:mi></m:msup>
 <m:mtext>&#8195; for &#8195;</m:mtext>
 <m:mi>w</m:mi><m:mo>&#8712;</m:mo><m:mi>C</m:mi>
 <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext">The function <m:math><m:mi>f</m:mi></m:math>&#160;is many-to-one, and so, except at <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mi>W</m:mi></m:math>&#160;is multivalued. C05BAF restricts <m:math><m:mi>W</m:mi></m:math>&#160;and its argument <m:math><m:mi>x</m:mi></m:math>&#160;to be real, resulting in a function defined for <m:math><m:mi>x</m:mi><m:mo>&#8805;</m:mo><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>&#160;and which is double valued on the interval <m:math><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow><m:mo>,</m:mo><m:mn>0</m:mn></m:mfenced></m:math>. This double-valued function is split into two real-valued branches according to the sign of <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>+</m:mo><m:mn>1</m:mn></m:math>. We denote by <m:math><m:msub><m:mi>W</m:mi><m:mn>0</m:mn></m:msub></m:math>&#160;the branch satisfying <m:math><m:msub><m:mi>W</m:mi><m:mn>0</m:mn></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>&#8805;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>&#160;for all real <m:math><m:mi>x</m:mi></m:math>, and by <m:math><m:msub><m:mi>W</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;the branch satisfying <m:math><m:msub><m:mi>W</m:mi><m:mrow><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>&#8804;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>&#160;for all real <m:math><m:mi>x</m:mi></m:math>. You may select your branch of interest using the parameter <a class="arg" href="#BRANCH">BRANCH</a>.</div><div class="paramtext">The precise method used to approximate <m:math><m:mi>W</m:mi></m:math>&#160;is described fully in <a class="ref" href="#ref804">Barry <span class="italic">et al.</span> (1995)</a>. For <m:math><m:mi>x</m:mi></m:math>&#160;close to <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>&#160;greater accuracy comes from evaluating <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow><m:mo>+</m:mo><m:mrow><m:mi>&#916;</m:mi><m:mi>x</m:mi></m:mrow></m:mfenced></m:math>&#160;rather than <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>: by setting <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#OFFSET"><m:mi mathcolor="#EE0000" mathvariant="bold">OFFSET</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;on entry you inform C05BAF that you are providing <m:math><m:mrow><m:mi>&#916;</m:mi><m:mi>x</m:mi></m:mrow></m:math>, not <m:math><m:mi>x</m:mi></m:math>, in <a class="arg" href="#X">X</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref804" id="ref804"/>Barry D J, Culligan&#8211;Hensley P J, and Barry S J (1995)  Real Values of the <m:math><m:mi>W</m:mi></m:math>-function <i>ACM Trans. Math. Software</i> <b>21 (2)</b> 161&#8211;171 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="X" id="X"/>1: &#160;&#160;&#8194; X &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#OFFSET"><m:mi mathcolor="#EE0000" mathvariant="bold">OFFSET</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, <a class="arg" href="#X">X</a> is the offset <m:math><m:mrow><m:mi>&#916;</m:mi><m:mi>x</m:mi></m:mrow></m:math>&#160;from <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>&#160;of the intended argument to <m:math><m:mi>W</m:mi></m:math>; that is, <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mi>&#946;</m:mi></m:mfenced></m:math>&#160;is computed, where <m:math><m:mi>&#946;</m:mi><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow><m:mo>+</m:mo><m:mrow><m:mi>&#916;</m:mi><m:mi>x</m:mi></m:mrow></m:math>. 
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#OFFSET"><m:mi mathcolor="#EE0000" mathvariant="bold">OFFSET</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, <a class="arg" href="#X">X</a> is the argument <m:math><m:mi>x</m:mi></m:math>&#160;of the function; that is, <m:math><m:mi>W</m:mi><m:mfenced separators=""><m:mi>&#946;</m:mi></m:mfenced></m:math>&#160;is computed, where <m:math><m:mi>&#946;</m:mi><m:mo>=</m:mo><m:mi>x</m:mi></m:math>.</div>
</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="#BRANCH"><m:mi mathcolor="#EE0000" mathvariant="bold">BRANCH</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow><m:mo>&#8804;</m:mo><m:mi>&#946;</m:mi></m:math>;</li>
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#BRANCH"><m:mi mathcolor="#EE0000" mathvariant="bold">BRANCH</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow><m:mo>&#8804;</m:mo><m:mi>&#946;</m:mi><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>.</li>
</ul></div>
</dd><dt class="paramhead"><a name="BRANCH" id="BRANCH"/>2: &#160;&#160;&#8194; BRANCH &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the real branch required.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#BRANCH"><m:mi mathcolor="#EE0000" mathvariant="bold">BRANCH</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>The branch <m:math><m:msub><m:mi>W</m:mi><m:mn>0</m:mn></m:msub></m:math>&#160;is selected.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#BRANCH"><m:mi mathcolor="#EE0000" mathvariant="bold">BRANCH</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math></dt>
<dd>The branch <m:math><m:msub><m:mi>W</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;is selected.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#BRANCH"><m:mi mathcolor="#EE0000" mathvariant="bold">BRANCH</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;or <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>.
</div>
</dd><dt class="paramhead"><a name="OFFSET" id="OFFSET"/>3: &#160;&#160;&#8194; OFFSET &#8211; LOGICAL<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: controls whether or not <a class="arg" href="#X">X</a> is being specified as an offset from <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>.</div>
</dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>4: &#160;&#160;&#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> C05BAF 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>
<div class="paramtext">An input parameter is invalid.  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;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>&#160;on entry, the output message provides more details of the nature of the warning.</div>
</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">Warning: the actual argument to <m:math><m:mi>W</m:mi></m:math>&#160;was very close to <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>. The output message provides more details of the nature of the warning.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">For a high percentage of legal <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction></m:math>&#160;on input, C05BAF is accurate to the number of decimal digits of precision on the host machine (see <a class="rout" href="../X02/x02bef.xml">X02BEF</a>). An extra digit may be lost on some implementations and for a small proportion of such <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction></m:math>. This depends on the accuracy of the base-<m:math><m:mn>10</m:mn></m:math>&#160;logarithm on your system.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">None.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example reads from a file the values of the required branch, whether or not the arguments to <m:math><m:mi>W</m:mi></m:math>&#160;are to be considered as offsets to <m:math><m:mrow><m:mo>-</m:mo><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:mrow></m:math>, and the arguments <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction></m:math>&#160;themselves. It then evaluates the function for these sets of input data <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction></m:math>&#160;and prints the results.</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/c05bafe.f">Program Text (c05bafe.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/c05bafe.d">Program&#160;Data (c05bafe.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/c05bafe.r">Program Results (c05bafe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/C05/c05baf.pdf">C05BAF (PDF version)</a></div><div><a class="chap" href="c05conts.xml">C05 Chapter Contents</a></div><div><a class="chapint" href="c05intro.xml">C05 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>
