Home

loggamma

LogGamma denotes the natural logarithm of the gamma function, written as log Γ(z) or sometimes lgamma. It is a complex-valued function defined for complex numbers z with Γ(z) ≠ 0, and for real arguments z > 0 it reduces to the natural logarithm of the gamma function, log Γ(z) = ln Γ(z). For positive integers n, log Γ(n) = ln (n-1)!.

Analytic structure: Γ has simple poles at nonpositive integers, so log Γ is analytic on the complex plane

Important identities include the recurrence log Γ(z+1) = log z + log Γ(z) and the reflection formula log

Asymptotics and computation: Stirling-type expansions give log Γ(z) ~ (z−1/2) log z − z + (1/2) log(2π) + ∑ B_{2k}/(2k(2k−1) z^{2k−1})

In programming, functions named loggamma or lgamma appear in many libraries; care is needed for complex arguments

minus
those
poles,
with
a
standard
branch
of
the
logarithm
chosen
on
the
complement
of
a
branch
cut.
The
derivative
of
log
Γ
is
the
digamma
function
ψ(z)
=
Γ'(z)/Γ(z);
higher
derivatives
are
the
polygamma
functions
ψ^(n)(z).
Γ(z)
+
log
Γ(1−z)
=
log
π
−
log
sin(π
z).
These,
together
with
multiplication
formulas,
underpin
many
theoretical
and
computational
properties
of
log
Γ.
for
large
|z|.
The
Lanczos
approximation
provides
practical
evaluation
with
good
accuracy
across
the
complex
plane.
In
statistics
and
combinatorics,
log
Γ
is
used
to
compute
log
factorials
and
log-likelihoods
to
avoid
overflow
and
improve
numerical
stability.
regarding
branch
choices
and
numerical
stability.