JuliaStats/Distributions.jl — pull request #209 by simonbyrne (2014-04-08 06:50:47+00:00)
Title: Poisson, gamma and chisq pdfs

This removes rmath dependence for Poisson, gamma and chi-squared pdfs and logpdfs. Also defines special functions:

* `log1pmx(x) = log(1+x) - x`
* `logmxp1(x) = log(x) - x + 1`
* `lstirling_asym(x)` is an asymptotic expansion for `lgamma(x) + x - (x-0.5)*log(x) - 0.5*log2π`

These are roughly based on the NSWC code, but have been modified a bit, such as using shorter polynomials for the special functions (since some of the NSWC ones were overkill for `Float64`), and taking advantage of IEEE754 properties such as exact subtraction and gradual underflow.