Difference between revisions of "LGamma"

(Copied from user guide)
m (hyperlinks)
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
= LGamma(X) =
+
== LGamma(X) ==
 +
Returns the Log [[GammaFn|Gamma function]] of «X».  Without numeric overflow, this function is exactly equivalent to <code>[[Ln]]([[GammaFn]](X))</code>.
 +
Because the gamma function grows so rapidly, it is often much more convenient to use [[LGamma]]() to avoid numeric overflow.
  
Returns the Log Gamma function of X.  Without numeric overflow, this function is exactly equivalent to ''[[Ln]]([[GammaFn]](X))''.
+
== LogBetaFn(x) ==
Because the gamma function grows so rapidly, it is often much more convenient to use ''LGamma()'' to avoid numeric overflow.
+
To compute <code>[[Ln]]([[BetaFn]](a,b))</code>, you should instead use
 
+
:<code>[[LGamma]](a) + [[LGamma]](b) - LGamma(a+b)</code>
= Library =
+
which is less susceptible to numeric underflow for really large values of <code>a</code> and <code>b</code>.
 
 
Advanced Math
 
 
 
= See Also =
 
  
 +
== See Also ==
 
* [[GammaFn]]
 
* [[GammaFn]]
 
* [[Factorial]]
 
* [[Factorial]]
 
* [[Ln]] -- natural log
 
* [[Ln]] -- natural log
 +
* [[BetaFn]]

Latest revision as of 21:25, 5 February 2016


LGamma(X)

Returns the Log Gamma function of «X». Without numeric overflow, this function is exactly equivalent to Ln(GammaFn(X)). Because the gamma function grows so rapidly, it is often much more convenient to use LGamma() to avoid numeric overflow.

LogBetaFn(x)

To compute Ln(BetaFn(a,b)), you should instead use

LGamma(a) + LGamma(b) - LGamma(a+b)

which is less susceptible to numeric underflow for really large values of a and b.

See Also

Comments


You are not allowed to post comments.