<?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>D01BBF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/D01/d01bbf.pdf">D01BBF (PDF version)</a></div><div><a class="chap" href="d01conts.xml">D01 Chapter Contents</a></div><div><a class="chapint" href="d01intro.xml">D01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>D01BBF</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">D01BBF returns the weights and abscissae appropriate to a Gaussian quadrature formula with a specified number of abscissae.  The formulae provided are Gauss&#8211;Legendre, Gauss&#8211;Rational, Gauss&#8211;Laguerre and Gauss&#8211;Hermite.</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;D01BBF&#160;(</td><td class="tdfspec2"><a class="arg" href="#D01XXX">D01XXX</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#B">B</a>, <a class="arg" href="#ITYPE">ITYPE</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#WEIGHT">WEIGHT</a>, <a class="arg" href="#ABSCIS">ABSCIS</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">ITYPE, N, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A, B, WEIGHT(N), ABSCIS(N)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">D01XXX</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D01BBF returns the weights and abscissae for use in the Gaussian quadrature of a function <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.  The quadrature takes the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><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>n</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are the weights and <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are the abscissae (see <a class="ref" href="#ref201">Davis and Rabinowitz (1975)</a>, <a class="ref" href="#ref220">Fr&#246;berg (1970)</a>, <a class="ref" href="#ref018">Ralston (1965)</a> or <a class="ref" href="#ref019">Stroud and Secrest (1966)</a>).</div><div class="paramtext">Weights and abscissae are available for Gauss&#8211;Legendre, Gauss&#8211;Rational, Gauss&#8211;Laguerre and Gauss&#8211;Hermite quadrature, and for a selection of values of <m:math><m:mi>n</m:mi></m:math>&#160;(see <a class="sec" href="#parameters">Section 5</a>).
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top">Gauss&#8211;Legendre Quadrature:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>b</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>a</m:mi></m:math>&#160;and <m:math><m:mi>b</m:mi></m:math>&#160;are finite and it will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><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>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mi>x</m:mi><m:mi>i</m:mi></m:msup><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top">Gauss&#8211;Rational quadrature:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>&#8734;</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>a</m:mi><m:mo>+</m:mo><m:mi>b</m:mi><m:mo>&gt;</m:mo> <m:mn>0</m:mn></m:mfenced> <m:mtext>&#8195; or &#8195;</m:mtext> <m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mi>a</m:mi></m:munderover> <m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>a</m:mi><m:mo>+</m:mo><m:mi>b</m:mi><m:mo>&lt;</m:mo> <m:mn>0</m:mn></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><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>2</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:mfrac><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mfenced separators=""><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mfenced><m:mi>i</m:mi></m:msup></m:mfrac><m:mo>=</m:mo><m:mfrac><m:mrow><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>-</m:mo><m:mi>i</m:mi></m:mrow></m:msub><m:msup><m:mfenced separators=""><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mfenced><m:mi>i</m:mi></m:msup></m:mrow><m:msup><m:mfenced separators=""><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mfenced><m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msup></m:mfrac><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(c)</td>
<td valign="top">Gauss&#8211;Laguerre quadrature, adjusted weights option:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>&#8734;</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>b</m:mi><m:mo>&gt;</m:mo> <m:mn>0</m:mn></m:mfenced> <m:mtext>&#8195; or &#8195;</m:mtext> <m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mi>a</m:mi></m:munderover> <m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>b</m:mi><m:mo>&lt;</m:mo> <m:mn>0</m:mn></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>b</m:mi><m:mi>x</m:mi></m:mrow></m:msup><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mi>x</m:mi><m:mi>i</m:mi></m:msup><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(d)</td>
<td valign="top">Gauss&#8211;Hermite quadrature, adjusted weights option:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow>
  <m:mrow><m:mo>+</m:mo><m:mi>&#8734;</m:mi></m:mrow></m:munderover> <m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

and will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>b</m:mi><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
<m:mn>2</m:mn></m:msup></m:mrow></m:msup><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mi>x</m:mi><m:mi>i</m:mi></m:msup><m:mtext>&#8195;</m:mtext><m:mfenced separators=""><m:mi>b</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(e)</td>
<td valign="top">Gauss&#8211;Laguerre quadrature, normal weights option:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>&#8734;</m:mi></m:munderover><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>b</m:mi><m:mi>x</m:mi></m:mrow></m:msup><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>b</m:mi><m:mo>&gt;</m:mo> <m:mn>0</m:mn></m:mfenced> <m:mtext>&#8195; or &#8195;</m:mtext> <m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mi>a</m:mi></m:munderover> <m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>b</m:mi><m:mi>x</m:mi></m:mrow></m:msup><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>&#8195;</m:mtext> <m:mfenced separators=""><m:mi>b</m:mi><m:mo>&lt;</m:mo> <m:mn>0</m:mn></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><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>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mi>x</m:mi><m:mi>i</m:mi></m:msup><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(f)</td>
<td valign="top">Gauss&#8211;Hermite quadrature, normal weights option:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow>
  <m:mrow><m:mo>+</m:mo><m:mi>&#8734;</m:mi></m:mrow></m:munderover> <m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>b</m:mi><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
<m:mn>2</m:mn></m:msup></m:mrow></m:msup><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced> <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow></m:math></td><td class="formula2"/></tr></table></div>

and will be exact for any function of the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>f</m:mi><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>0</m:mn></m:mrow>
  <m:mrow><m:mn>2</m:mn><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:munderover><m:msub><m:mi>c</m:mi><m:mi>i</m:mi></m:msub><m:msup><m:mi>x</m:mi><m:mi>i</m:mi></m:msup><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
</td>
</tr></table>
<b>Note:</b>&#160; that the Gauss&#8211;Legendre abscissae, with <m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>,
<m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mo>+</m:mo><m:mn>1</m:mn></m:math>, are the zeros of the Legendre polynomials; the  Gauss&#8211;Laguerre abscissae, with <m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>,  are the zeros of the Laguerre polynomials; and the Gauss&#8211;Hermite abscissae,  with <m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, are the zeros of the Hermite polynomials.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref201" id="ref201"/>Davis P J and Rabinowitz P (1975)  <i>Methods of Numerical Integration</i> Academic Press </div>
<div class="paramtext"><a name="ref220" id="ref220"/>Fr&#246;berg C E (1970)  <i>Introduction to Numerical Analysis</i> Addison&#8211;Wesley </div>
<div class="paramtext"><a name="ref018" id="ref018"/>Ralston A (1965)  <i>A First Course in Numerical Analysis</i> pp.&#160;87&#8211;90 McGraw&#8211;Hill </div>
<div class="paramtext"><a name="ref019" id="ref019"/>Stroud A H and Secrest D (1966)  <i>Gaussian Quadrature Formulas</i> Prentice&#8211;Hall </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="D01XXX" id="D01XXX"/>1: &#160;&#160;&#8194; D01XXX &#8211; SUBROUTINE, supplied by the NAG Library.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext">The name of the routine indicates the quadrature formula:
<ul class="listind"><li class="listind">D01BAZ, for Gauss&#8211;Legendre weights and abscissae;</li><li class="listind">D01BAY, for Gauss&#8211;Rational weights and abscissae;</li><li class="listind">D01BAX, for Gauss&#8211;Laguerre weights and abscissae;</li><li class="listind">D01BAW, for Gauss&#8211;Hermite weights and abscissae.</li></ul>
</div>
<div class="paramtext">The name used must be declared as EXTERNAL in the subroutine from which D01BBF is called.</div></dd><dt class="paramhead"><a name="A" id="A"/>2: &#160;&#160;&#8194; A &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="B" id="B"/>3: &#160;&#160;&#8194; B &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the quantities <m:math><m:mi>a</m:mi></m:math>&#160;and <m:math><m:mi>b</m:mi></m:math>&#160;as described in the appropriate sub-section of <a class="sec" href="#description">Section 3</a>.</div></dd><dt class="paramhead"><a name="ITYPE" id="ITYPE"/>4: &#160;&#160;&#8194; ITYPE &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates the type of weights for Gauss&#8211;Laguerre or Gauss&#8211;Hermite quadrature (see <a class="sec" href="#description">Section 3</a>).

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>Adjusted weights will be returned.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Normal weights will be returned.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;or <m:math><m:mn>1</m:mn></m:math>.
<div class="paramtext">For Gauss&#8211;Legendre or Gauss&#8211;Rational quadrature, this parameter is not used</div></div></dd><dt class="paramhead"><a name="N" id="N"/>5: &#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 number of weights and abscissae to be returned.</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:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>4</m:mn></m:math>, <m:math><m:mn>5</m:mn></m:math>, <m:math><m:mn>6</m:mn></m:math>, <m:math><m:mn>8</m:mn></m:math>, <m:math><m:mn>10</m:mn></m:math>, <m:math><m:mn>12</m:mn></m:math>, <m:math><m:mn>14</m:mn></m:math>, <m:math><m:mn>16</m:mn></m:math>, <m:math><m:mn>20</m:mn></m:math>, <m:math><m:mn>24</m:mn></m:math>, <m:math><m:mn>32</m:mn></m:math>, <m:math><m:mn>48</m:mn></m:math>&#160;or <m:math><m:mn>64</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="WEIGHT" id="WEIGHT"/>6: &#160;&#160;&#8194; WEIGHT(<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>: the <a class="arg" href="#N">N</a> weights. For Gauss&#8211;Laguerre and Gauss&#8211;Hermite quadrature, these will be the adjusted weights if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, and the normal weights if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>.</div></dd><dt class="paramhead"><a name="ABSCIS" id="ABSCIS"/>7: &#160;&#160;&#8194; ABSCIS(<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>: the <a class="arg" href="#N">N</a> abscissae.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>8: &#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, 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>
<div class="paramtext">The N-point rule is not among those stored.  If the soft fail option is used, the weights and abscissae returned will be those for the largest valid value of <a class="arg" href="#N">N</a> less than the requested value, and the excess elements of <a class="arg" href="#WEIGHT">WEIGHT</a> and <a class="arg" href="#ABSCIS">ABSCIS</a> (i.e., up to the requested <a class="arg" href="#N">N</a>) will be filled with zeros.</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">The value of <a class="arg" href="#A">A</a> and/or <a class="arg" href="#B">B</a> is invalid.</div>
<div class="paramtext">Gauss&#8211;Rational: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;<br/>
Gauss&#8211;Laguerre:  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;<br/>
Gauss&#8211;Hermite: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0</m:mn></m:math></div>
<div class="paramtext">If the soft fail option is used the weights and abscissae are returned as zero.</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">Laguerre and Hermite normal weights only: underflow is occurring in evaluating one or more of the normal weights.  If the soft fail option is used, the underflowing weights are returned as zero.  A smaller value of <a class="arg" href="#N">N</a> must be used; or adjusted weights should be used (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITYPE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITYPE</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>).  In the latter case, take care that underflow does not occur when evaluating the integrand appropriate for adjusted weights.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The weights and abscissae are stored for standard values of <a class="arg" href="#A">A</a> and <a class="arg" href="#B">B</a> to full machine accuracy.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">Timing is negligible.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example returns the abscissae and (adjusted) weights for the six-point Gauss&#8211;Laguerre formula.</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/d01bbfe.f">Program Text (d01bbfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<div class="paramtext">None.</div><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/d01bbfe.r">Program Results (d01bbfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/D01/d01bbf.pdf">D01BBF (PDF version)</a></div><div><a class="chap" href="d01conts.xml">D01 Chapter Contents</a></div><div><a class="chapint" href="d01intro.xml">D01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
