Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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
- gammaLanczos :: Floating a => a -> [a] -> a -> a
- lnGammaLanczos :: Floating a => a -> [a] -> a -> a
- reflect :: (RealFloat a, Ord a) => (a -> a) -> a -> a
- reflectC :: RealFloat a => (Complex a -> Complex a) -> Complex a -> Complex a
- reflectLn :: (RealFloat a, Ord a) => (a -> a) -> a -> a
- reflectLnC :: RealFloat a => (Complex a -> Complex a) -> Complex a -> Complex a
Documentation
gammaLanczos :: Floating a => a -> [a] -> a -> a Source #
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.