mozilla/rust — pull request #6098 by huonw (2013-04-28 14:42:08+00:00)
Title: Add normal and exponential distributions to core::rand

(This is only dd4f80f.)

Very basic support for sampling from N(0,1) and Exp(1). This is basically my experimentations with the Ziggurat algorithm, and will certainly get reorganised when [Lib-rand](https://github.com/mozilla/rust/wiki/Lib-rand) gets finished.

No tests or anything, other than generating 1 million numbers from each distribution, loading it into R and plotting and performing some basic tests (which passed) i.e. Pearson's chi-squared for the Exp(1) values, and Shapiro-Wilks for the N(0,1) values.

![normal-exp](https://f.cloud.github.com/assets/1203825/435879/097fbf4e-b011-11e2-90fe-6cf9a7f80dce.png)

(These will be tested better when the lib rand changes linked above start to happen.)