Mir Random [WIP]

Joseph Rushton Wakeling via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 23 02:33:21 PST 2016


On Wednesday, 23 November 2016 at 05:26:12 UTC, Ilya Yaroshenko 
wrote:
> Mir Random is going to be a library with saturated uniform FP 
> RNGs and almost saturated exponential FP RNGs. Comparing with 
> all other libraries (any language) the basic uniform FP numbers 
> will be generated in interval (-1, +1) and contains _all_ 
> possible values including all subnormal numbers. 64 bit 
> generators are 2 times faster for this task if you need to 
> generate a 64 bit floating point number. Explanation of 
> technique will be in my post/article. --Ilya

All of which is fine in its own terms, but why prioritize the 
speed of the default behaviour over its reliability and 
reproducibility?

Anyone who cares about that combination of speed and statistical 
quality will have enough information in the documentation to know 
what to do.  By contrast producing different results for 
identical user code depending on whether you're making a 32- or 
64-bit build is an unpleasant complication it could be better to 
avoid.

In any case, given what you say above, shouldn't the choice of 
32- vs. 64-bit RNG depend on whether one is using a distribution 
that generates 32- vs. 64-bit floating-point variates, rather 
than whether one is building for a 32- or 64-bit target?  In 
which case it needs to be a user choice, since it's only the user 
who knows what distribution they're using.


More information about the Digitalmars-d mailing list