blob: 85361dc031b0dd55bf8f05907da5d3116964082b [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Gamma (Apache Commons Math 3.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Gamma (Apache Commons Math 3.3 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Gamma.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/math3/special/Erf.html" title="class in org.apache.commons.math3.special"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/math3/special/Gamma.html" target="_top">Frames</a></li>
<li><a href="Gamma.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.special</div>
<h2 title="Class Gamma" class="title">Class Gamma</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.special.Gamma</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">Gamma</span>
extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><p>
This is a utility class that provides computation methods related to the
&Gamma; (Gamma) family of functions.
</p>
<p>
Implementation of <a href="../../../../../org/apache/commons/math3/special/Gamma.html#invGamma1pm1(double)"><code>invGamma1pm1(double)</code></a> and
<a href="../../../../../org/apache/commons/math3/special/Gamma.html#logGamma1p(double)"><code>logGamma1p(double)</code></a> is based on the algorithms described in
<ul>
<li><a href="http://dx.doi.org/10.1145/22721.23109">Didonato and Morris
(1986)</a>, <em>Computation of the Incomplete Gamma Function Ratios and
their Inverse</em>, TOMS 12(4), 377-393,</li>
<li><a href="http://dx.doi.org/10.1145/131766.131776">Didonato and Morris
(1992)</a>, <em>Algorithm 708: Significant Digit Computation of the
Incomplete Beta Function Ratios</em>, TOMS 18(3), 360-373,</li>
</ul>
and implemented in the
<a href="http://www.dtic.mil/docs/citations/ADA476840">NSWC Library of Mathematical Functions</a>,
available
<a href="http://www.ualberta.ca/CNS/RESEARCH/Software/NumericalNSWC/site.html">here</a>.
This library is "approved for public release", and the
<a href="http://www.dtic.mil/dtic/pdf/announcements/CopyrightGuidance.pdf">Copyright guidance</a>
indicates that unless otherwise stated in the code, all FORTRAN functions in
this library are license free. Since no such notice appears in the code these
functions can safely be ported to Commons-Math.
</p></div>
<dl><dt><span class="strong">Version:</span></dt>
<dd>$Id: Gamma.java 1538368 2013-11-03 13:57:37Z erans $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#GAMMA">GAMMA</a></strong></code>
<div class="block"><a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni constant</a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#LANCZOS_G">LANCZOS_G</a></strong></code>
<div class="block">The value of the <code>g</code> constant in the Lanczos approximation, see
<a href="../../../../../org/apache/commons/math3/special/Gamma.html#lanczos(double)"><code>lanczos(double)</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#digamma(double)">digamma</a></strong>(double&nbsp;x)</code>
<div class="block">Computes the digamma function of x.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#gamma(double)">gamma</a></strong>(double&nbsp;x)</code>
<div class="block">Returns the value of Γ(x).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#invGamma1pm1(double)">invGamma1pm1</a></strong>(double&nbsp;x)</code>
<div class="block">Returns the value of 1 / &Gamma;(1 + x) - 1 for -0&#46;5 &le; x &le;
1&#46;5.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#lanczos(double)">lanczos</a></strong>(double&nbsp;x)</code>
<div class="block">
Returns the Lanczos approximation used to compute the gamma function.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#logGamma(double)">logGamma</a></strong>(double&nbsp;x)</code>
<div class="block">
Returns the value of log&nbsp;&Gamma;(x) for x&nbsp;&gt;&nbsp;0.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#logGamma1p(double)">logGamma1p</a></strong>(double&nbsp;x)</code>
<div class="block">Returns the value of log &Gamma;(1 + x) for -0&#46;5 &le; x &le; 1&#46;5.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)">regularizedGammaP</a></strong>(double&nbsp;a,
double&nbsp;x)</code>
<div class="block">Returns the regularized gamma function P(a, x).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double, double, int)">regularizedGammaP</a></strong>(double&nbsp;a,
double&nbsp;x,
double&nbsp;epsilon,
int&nbsp;maxIterations)</code>
<div class="block">Returns the regularized gamma function P(a, x).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#regularizedGammaQ(double, double)">regularizedGammaQ</a></strong>(double&nbsp;a,
double&nbsp;x)</code>
<div class="block">Returns the regularized gamma function Q(a, x) = 1 - P(a, x).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#regularizedGammaQ(double, double, double, int)">regularizedGammaQ</a></strong>(double&nbsp;a,
double&nbsp;x,
double&nbsp;epsilon,
int&nbsp;maxIterations)</code>
<div class="block">Returns the regularized gamma function Q(a, x) = 1 - P(a, x).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/special/Gamma.html#trigamma(double)">trigamma</a></strong>(double&nbsp;x)</code>
<div class="block">Computes the trigamma function of x.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="GAMMA">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>GAMMA</h4>
<pre>public static final&nbsp;double GAMMA</pre>
<div class="block"><a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni constant</a></div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.math3.special.Gamma.GAMMA">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="LANCZOS_G">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LANCZOS_G</h4>
<pre>public static final&nbsp;double LANCZOS_G</pre>
<div class="block">The value of the <code>g</code> constant in the Lanczos approximation, see
<a href="../../../../../org/apache/commons/math3/special/Gamma.html#lanczos(double)"><code>lanczos(double)</code></a>.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.math3.special.Gamma.LANCZOS_G">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="logGamma(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logGamma</h4>
<pre>public static&nbsp;double&nbsp;logGamma(double&nbsp;x)</pre>
<div class="block"><p>
Returns the value of log&nbsp;&Gamma;(x) for x&nbsp;&gt;&nbsp;0.
</p>
<p>
For x &le; 8, the implementation is based on the double precision
implementation in the <em>NSWC Library of Mathematics Subroutines</em>,
<code>DGAMLN</code>. For x &gt; 8, the implementation is based on
</p>
<ul>
<li><a href="http://mathworld.wolfram.com/GammaFunction.html">Gamma
Function</a>, equation (28).</li>
<li><a href="http://mathworld.wolfram.com/LanczosApproximation.html">
Lanczos Approximation</a>, equations (1) through (5).</li>
<li><a href="http://my.fit.edu/~gabdo/gamma.txt">Paul Godfrey, A note on
the computation of the convergent Lanczos complex Gamma
approximation</a></li>
</ul></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value of <code>log(Gamma(x))</code>, <code>Double.NaN</code> if
<code>x &lt;= 0.0</code>.</dd></dl>
</li>
</ul>
<a name="regularizedGammaP(double, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>regularizedGammaP</h4>
<pre>public static&nbsp;double&nbsp;regularizedGammaP(double&nbsp;a,
double&nbsp;x)</pre>
<div class="block">Returns the regularized gamma function P(a, x).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - Parameter.</dd><dd><code>x</code> - Value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the regularized gamma function P(a, x).</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if the algorithm fails to converge.</dd></dl>
</li>
</ul>
<a name="regularizedGammaP(double, double, double, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>regularizedGammaP</h4>
<pre>public static&nbsp;double&nbsp;regularizedGammaP(double&nbsp;a,
double&nbsp;x,
double&nbsp;epsilon,
int&nbsp;maxIterations)</pre>
<div class="block">Returns the regularized gamma function P(a, x).
The implementation of this method is based on:
<ul>
<li>
<a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
Regularized Gamma Function</a>, equation (1)
</li>
<li>
<a href="http://mathworld.wolfram.com/IncompleteGammaFunction.html">
Incomplete Gamma Function</a>, equation (4).
</li>
<li>
<a href="http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html">
Confluent Hypergeometric Function of the First Kind</a>, equation (1).
</li>
</ul></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - the a parameter.</dd><dd><code>x</code> - the value.</dd><dd><code>epsilon</code> - When the absolute value of the nth item in the
series is less than epsilon the approximation ceases to calculate
further elements in the series.</dd><dd><code>maxIterations</code> - Maximum number of "iterations" to complete.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the regularized gamma function P(a, x)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if the algorithm fails to converge.</dd></dl>
</li>
</ul>
<a name="regularizedGammaQ(double, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>regularizedGammaQ</h4>
<pre>public static&nbsp;double&nbsp;regularizedGammaQ(double&nbsp;a,
double&nbsp;x)</pre>
<div class="block">Returns the regularized gamma function Q(a, x) = 1 - P(a, x).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - the a parameter.</dd><dd><code>x</code> - the value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the regularized gamma function Q(a, x)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if the algorithm fails to converge.</dd></dl>
</li>
</ul>
<a name="regularizedGammaQ(double, double, double, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>regularizedGammaQ</h4>
<pre>public static&nbsp;double&nbsp;regularizedGammaQ(double&nbsp;a,
double&nbsp;x,
double&nbsp;epsilon,
int&nbsp;maxIterations)</pre>
<div class="block">Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
The implementation of this method is based on:
<ul>
<li>
<a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
Regularized Gamma Function</a>, equation (1).
</li>
<li>
<a href="http://functions.wolfram.com/GammaBetaErf/GammaRegularized/10/0003/">
Regularized incomplete gamma function: Continued fraction representations
(formula 06.08.10.0003)</a>
</li>
</ul></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - the a parameter.</dd><dd><code>x</code> - the value.</dd><dd><code>epsilon</code> - When the absolute value of the nth item in the
series is less than epsilon the approximation ceases to calculate
further elements in the series.</dd><dd><code>maxIterations</code> - Maximum number of "iterations" to complete.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the regularized gamma function P(a, x)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if the algorithm fails to converge.</dd></dl>
</li>
</ul>
<a name="digamma(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>digamma</h4>
<pre>public static&nbsp;double&nbsp;digamma(double&nbsp;x)</pre>
<div class="block"><p>Computes the digamma function of x.</p>
<p>This is an independently written implementation of the algorithm described in
Jose Bernardo, Algorithm AS 103: Psi (Digamma) Function, Applied Statistics, 1976.</p>
<p>Some of the constants have been changed to increase accuracy at the moderate expense
of run-time. The result should be accurate to within 10^-8 absolute tolerance for
x >= 10^-5 and within 10^-8 relative tolerance for x > 0.</p>
<p>Performance for large negative values of x will be quite expensive (proportional to
|x|). Accuracy for negative values of x should be about 10^-8 absolute for results
less than 10^5 and 10^-8 relative for results larger than that.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>digamma(x) to within 10-8 relative or absolute error whichever is smaller.</dd><dt><span class="strong">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://en.wikipedia.org/wiki/Digamma_function">Digamma</a>,
<a href="http://www.uv.es/~bernardo/1976AppStatist.pdf">Bernardo&apos;s original article </a></dd></dl>
</li>
</ul>
<a name="trigamma(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>trigamma</h4>
<pre>public static&nbsp;double&nbsp;trigamma(double&nbsp;x)</pre>
<div class="block">Computes the trigamma function of x.
This function is derived by taking the derivative of the implementation
of digamma.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>trigamma(x) to within 10-8 relative or absolute error whichever is smaller</dd><dt><span class="strong">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://en.wikipedia.org/wiki/Trigamma_function">Trigamma</a>,
<a href="../../../../../org/apache/commons/math3/special/Gamma.html#digamma(double)"><code>digamma(double)</code></a></dd></dl>
</li>
</ul>
<a name="lanczos(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lanczos</h4>
<pre>public static&nbsp;double&nbsp;lanczos(double&nbsp;x)</pre>
<div class="block"><p>
Returns the Lanczos approximation used to compute the gamma function.
The Lanczos approximation is related to the Gamma function by the
following equation
<center>
<code>gamma(x) = sqrt(2 * pi) / x * (x + g + 0.5) ^ (x + 0.5)
* exp(-x - g - 0.5) * lanczos(x)</code>,
</center>
where <code>g</code> is the Lanczos constant.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The Lanczos approximation.</dd><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://mathworld.wolfram.com/LanczosApproximation.html">Lanczos Approximation</a>
equations (1) through (5), and Paul Godfrey's
<a href="http://my.fit.edu/~gabdo/gamma.txt">Note on the computation
of the convergent Lanczos complex Gamma approximation</a></dd></dl>
</li>
</ul>
<a name="invGamma1pm1(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invGamma1pm1</h4>
<pre>public static&nbsp;double&nbsp;invGamma1pm1(double&nbsp;x)</pre>
<div class="block">Returns the value of 1 / &Gamma;(1 + x) - 1 for -0&#46;5 &le; x &le;
1&#46;5. This implementation is based on the double precision
implementation in the <em>NSWC Library of Mathematics Subroutines</em>,
<code>DGAM1</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The value of <code>1.0 / Gamma(1.0 + x) - 1.0</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if <code>x &lt; -0.5</code></dd>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></code> - if <code>x &gt; 1.5</code></dd><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
<a name="logGamma1p(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logGamma1p</h4>
<pre>public static&nbsp;double&nbsp;logGamma1p(double&nbsp;x)
throws <a href="../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>,
<a href="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></pre>
<div class="block">Returns the value of log &Gamma;(1 + x) for -0&#46;5 &le; x &le; 1&#46;5.
This implementation is based on the double precision implementation in
the <em>NSWC Library of Mathematics Subroutines</em>, <code>DGMLN1</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The value of <code>log(Gamma(1 + x))</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if <code>x &lt; -0.5</code>.</dd>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></code> - if <code>x &gt; 1.5</code>.</dd><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
<a name="gamma(double)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>gamma</h4>
<pre>public static&nbsp;double&nbsp;gamma(double&nbsp;x)</pre>
<div class="block">Returns the value of Γ(x). Based on the <em>NSWC Library of
Mathematics Subroutines</em> double precision implementation,
<code>DGAMMA</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value of <code>Gamma(x)</code>.</dd><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Gamma.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/math3/special/Erf.html" title="class in org.apache.commons.math3.special"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/math3/special/Gamma.html" target="_top">Frames</a></li>
<li><a href="Gamma.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>