Normal/Gaussian random number generation for D

bearophile bearophileHUGS at lycos.com
Tue Oct 23 06:50:27 PDT 2012


Joseph Rushton Wakeling:

Thank you for the work on this. A normals generator is quite 
needed in Phobos.

> I've so far implemented one underlying engine, the Box-Muller 
> method currently
> used in Boost.  This is not the best engine possible -- an 
> implementation of the
> Ziggurat algorithm is desirable -- but it represents what is 
> typically used in
> other libraries.

Using the Boost API is useful. And using D-specific 
features/syntax is equally good.
Using the Ziggurat algorithm is desired, otherwise people will 
have to implement it outside Phobos, because it's better if you 
have to generate many normal distributed values (and sometimes I 
need many of them). is it possible to have both algorithms? Maybe 
with a template argument?

Bye,
bearophile


More information about the Digitalmars-d mailing list