Safe Haskell | None |
---|---|

Language | Haskell2010 |

Stirling's approximation to the gamma function and utility functions for selecting coefficients.

# Documentation

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

cs :: (Fractional a, Ord a) => [a] Source #

The c_n series in the convergent version of Stirling's approximation given on wikipedia at http://en.wikipedia.org/wiki/Stirling%27s_approximation#A_convergent_version_of_Stirling.27s_formula as fetched on 11 June 2010.

terms :: (Num t, Floating a, Ord a) => a -> a -> t Source #

Compute the number of terms required to achieve a given precision for a given value of z. The mamimum will typically (always?) be around 1, and seems to be more or less independent of the precision desired (though not of the machine epsilon - essentially, near zero I think this method is extremely numerically unstable).