Difference between revisions of "LGamma"

Line 6: Line 6:
 
Because the gamma function grows so rapidly, it is often much more convenient to use [[LGamma]]() to avoid numeric overflow.
 
Because the gamma function grows so rapidly, it is often much more convenient to use [[LGamma]]() to avoid numeric overflow.
  
== Library ==
+
== LogBetaFn(x) ==
Advanced Math
+
To compute <code>[[Ln]]([[BetaFn]](a,b))</code>, you should instead use
 +
:<code>[[LGamma]](a) + [[LGamma]](b) - LGamma(a+b)</code>
 +
which is less susceptible to numeric overflow for really large values of <code>a</code> and <code>b</code>.
  
 
== See Also ==
 
== See Also ==
Line 13: Line 15:
 
* [[Factorial]]
 
* [[Factorial]]
 
* [[Ln]] -- natural log
 
* [[Ln]] -- natural log
 +
* [[BetaFn]]

Revision as of 21:19, 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 overflow for really large values of a and b.

See Also

Comments


You are not allowed to post comments.