Skip to content

GammaLn

The natural logarithm of , avoiding the overflow of computing Gamma directly for large z.

WikipediaGamma functionMathWorldLogGammaFunctionGammaFunctionWikidataQ190573Encyclopedia of MathematicsGamma-functionnLabGamma functionBritannicascience/gamma-functionDLMF5.2.E1FungrimLogGammaFungrim entryWolfram LanguageLogGamma
GammaLn(z), useful where itself would overflow.

Domain: Special functions

Details
  • Defined via Gamma: for , where is positive so no branch-cut ambiguity arises.
  • Called gammaln in MATLAB and SciPy, lgamma in C's math library.
  • Inherits Gamma's recurrence in log form: .
  • , from .
  • Diverges to at the nonpositive integers, the poles of Gamma -- the log of a diverging magnitude, rather than the ComplexInfinity that Gamma itself returns there.
  • It is with a PRINCIPAL logarithm, which for complex is not the same function as Wolfram's : the two differ by multiples of off the positive axis. LogGamma is that continuation, and the one to use where continuity in matters.

Examples

See also: Gamma, LogGamma, Digamma