ln_gamma
Version 1.0.1 (2.22 KB) by
Alexey_Kuznetsov
Computes the logarithm of the Gamma function in the entire complex plane.
This function computes the logarithm of the gamma function in the entire complex plane. The algorithm is based on approximating the log(Gamma(z)) in the half-plane Re(z)>1.5 by an algorithm from [1] (with improved coefficients obtained in [2]). This approximation is correct to 10^{-16} (though round-off errors may decrease the accuracy). The approximation in the half-plane Re(z)>1.5 is then used to compute ln(Gamma(z)) in the entire complex plane by the use of reflection formula and the functional equation.
References:
[1] A. Kuznetsov, "Computing the Barnes G-function and the gamma function in the entire complex plane," Journal of Computational and Applied Mathematics, Vol. 411, 2022, 114270. https://doi.org/10.1016/j.cam.2022.114270
[2] A. Kuznetsov, A. Mohammadioroojeh, "Approximating functions on R^+ by exponential sums", 2025, preprint, https://arxiv.org/abs/2508.19095
Cite As
Alexey_Kuznetsov (2025). ln_gamma (https://uk.mathworks.com/matlabcentral/fileexchange/182573-ln_gamma), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2025b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
