gamma-0.10.0.0: Gamma function and related functions.

Math.Gamma.Lanczos

Description

Lanczos' approximation to the gamma function, as described at http://en.wikipedia.org/wiki/Lanczos_approximation (fetched 11 June 2010).

Constants to be supplied by user. There is a file "extras/LanczosConstants.hs" in the source repository that implements a technique by Paul Godfrey for calculating the coefficients. It is not included in the distribution yet because it makes use of a linear algebra library I have not yet released (though I eventually intend to).

Synopsis

# Documentation

gammaLanczos :: Floating a => a -> [a] -> a -> a Source #

Compute Lanczos' approximation to the gamma function, using the specified constants. Valid for Re(x) > 0.5. Use reflect or reflectC to extend to the whole real line or complex plane, respectively.

lnGammaLanczos :: Floating a => a -> [a] -> a -> a Source #

Compute Lanczos' approximation to the natural logarithm of the gamma function, using the specified constants. Valid for Re(x) > 0.5. Use reflectLn or reflectLnC to extend to the whole real line or complex plane, respectively.

reflect :: (RealFloat a, Ord a) => (a -> a) -> a -> a Source #

Extend an approximation of the gamma function from the domain x > 0.5 to the whole real line.

reflectC :: RealFloat a => (Complex a -> Complex a) -> Complex a -> Complex a Source #

Extend an approximation of the gamma function from the domain Re(x) > 0.5 to the whole complex plane.

reflectLn :: (RealFloat a, Ord a) => (a -> a) -> a -> a Source #

Extend an approximation of the natural logarithm of the gamma function from the domain x > 0.5 to the whole real line.

reflectLnC :: RealFloat a => (Complex a -> Complex a) -> Complex a -> Complex a Source #

Extend an approximation of the natural logarithm of the gamma function from the domain Re(x) > 0.5 to the whole complex plane.