BurntSushi / quickcheck

Automated property based testing for Rust (with shrinking).
The Unlicense
2.4k stars 149 forks source link

Make Gen expose log-normal distributions #172

Closed sunshowers closed 4 years ago

sunshowers commented 7 years ago

So all the methods on Gen currently expose uniform distributions. However, log-normal (or other similar) distributions can be more representative of real-world data. In particular, it can be useful to generate data that has lots of smaller values and a few big ones, which log-normal distributions naturally are.

rand already has log-normal distributions implemented, so it should just be a matter of setting up a reasonable value based on size and calling it.

People can do this by hand already, I guess, but I think it would still be useful to have.

BurntSushi commented 4 years ago

I doubt very much that I will ever have the bandwidth to design or review or maintain something like this. I'd recommend trying to figure out how to do this in a separate crate.