Barnes' double Gamma function
This package provides an implementation of the multiple $\Gamma$ functions $G, \Gamma_2, \Gamma_b$ as defined in this wikipedia article.
Algorithm
Internally, the double gamma functions are computed using a product formula from this paper:
\[G(z ; \tau)=\frac{1}{\tau \Gamma(z)} e^{\tilde{a}(\tau) \frac{z}{\tau}+\tilde{b}(\tau) \frac{z^2}{2 \tau^2}} \prod_{m \geq 1} \frac{\Gamma(m \tau)}{\Gamma(z+m \tau)} e^{z \psi(m \tau)+\frac{z^2}{2} \psi^{\prime}(m \tau)},\]
where
\[\begin{aligned} C(\tau) & :=\sum_{k=1}^{m-1} \psi(k \tau)+\frac{1}{2} \psi(m \tau)-\frac{1}{\tau} \ln \left(\frac{\Gamma(m \tau)}{\sqrt{2 \pi}}\right)-\frac{\tau}{12} \psi^{\prime}(m \tau) \\ & +\frac{\tau^3}{720} \psi^{(3)}(m \tau)-\frac{\tau^5}{30240} \psi^{(5)}(m \tau)+\frac{\tau^7}{1209600} \psi^{(7)}(m \tau)+O\left(m^{-9}\right) \\ D(\tau) & :=\sum_{k=1}^{m-1} \psi^{\prime}(k \tau)+\frac{1}{2} \psi^{\prime}(m \tau)-\frac{1}{\tau} \psi(m \tau)-\frac{\tau}{12} \psi^{\prime \prime}(m \tau) \\ & +\frac{\tau^3}{720} \psi^{(4)}(m \tau)-\frac{\tau^5}{30240} \psi^{(6)}(m \tau)+\frac{\tau^7}{1209600} \psi^{(8)}(m \tau)+O\left(m^{-10}\right) . \end{aligned}\]
and
\[\tilde{a}(\tau)=a(\tau)-\gamma \tau=\frac{\tau}{2} \ln (2 \pi \tau)+\frac{1}{2} \ln (\tau)-\tau C(\tau), \quad \tilde{b}(\tau)=b(\tau)+\frac{\pi^2 \tau^2}{6}=-\tau \ln (\tau)-\tau^2 D(\tau),\]
the functions $\Gamma$ and $\psi$ are the Euler gamma and digamma function:
\[\psi(z) = (\log \Gamma)'(z).\]
Functions exported by the module
BarnesDoubleGamma.logdoublegamma
— Function logdoublegamma(w, β; tol=10^(-precision(w)))
Compute the logarithm of the double gamma function $Γ_β(w, β)$ with precision tol
BarnesDoubleGamma.doublegamma
— Function doublegamma(w, β; tol=10^(-precision(w)))
Compute the double gamma function $Γ_β(w)$ with precision tol
BarnesDoubleGamma.log_barnesdoublegamma
— Functionlog_barnesdoublegamma(z, τ; tol = 10^(-precision(z)))
Logarithm of Barne's G-function $\log(G(z; τ))$, up to a given tolerance. The tolerance is rather pessimistic. For efficiency, when using a high precision z
it is recommended to set the tolerance to something lower than the precision of z
.
Examples
julia> z = 1; τ = sqrt(3); log_barnesdoublegamma(z, τ)
4.7036054521762405e-12
julia> z = sqrt(big"2"); τ = sqrt(big"3"); log_barnesdoublegamma(z, τ)
0.293394920968626643183216869255154162603276161914057065216580158409738193128475
BarnesDoubleGamma.barnesdoublegamma
— Functionbarnesdoublegamma(z, τ; tol=10^(-precision(z)))
Barne's G-function $G(z, τ)$, up to a given tolerance. For efficiency, when using a high precision z
it is recommended to set the tolerance to something lower than the precision of z
.
Examples
julia> z = big"1"; τ = sqrt(big"3"); barnesdoublegamma(z, τ)
0.9999999999999999999999999999999999999999999345543169494792740822465202042518853
julia> z = sqrt(big"2"); τ = sqrt(big"3"); barnesdoublegamma(z, τ)
1.340972263940081256497568500074283394055091669857109294097794355305731639439863
julia> z = big(sqrt(3)); τ = sqrt(big"3"); barnesdoublegamma(z, τ)
1.488928335365086422942328604671778776079655470648475974888882080914824321973775
BarnesDoubleGamma.loggamma2
— Functionloggamma2(w, β; tol=10^(-precision(z)))
Logarithm of the $Γ_2(w, β)$ function. For efficiency, when using a high precision w
it is recommended to set the tolerance to something lower than the precision of w
.
BarnesDoubleGamma.gamma2
— Functiongamma2(w, β; tol=10^(-precision(w)))
$Γ_2(w, β)$ function. For efficiency, when using a high precision w
it is recommended to set the tolerance to something lower than the precision of w
.