OT: random random stuff [Was: Re: default random object?]

Don nospam at nospam.com
Fri Feb 20 00:13:50 PST 2009


Daniel Keep wrote:
> Slightly off-topic, but I just found this and thought it might be of
> interest.
> 
> http://mjolnirstudios.com/IanBullard/files/79ffbca75a75720f066d491e9ea935a0-10.php
> 
> For reference, here is the ASM source for the mentioned Flipcode random
> number generator:
> 
>> pshufw mm1, mm0, 0x1E
>> paddd mm0, mm1
> 
> Finally, here's a link to the DieHard test on Wikipedia:
> 
> http://en.wikipedia.org/wiki/Diehard_tests
> 
> 
>  -- Daniel

Yeah. It's worth knowing that reason that linear congruential RNGs have 
historically been used so much is because _they are the easiest to 
analyze mathematically_, NOT because they are good in either speed or 
randomness. Since the early days, the techniques for evaluating RNGs 
have improved dramatically (and the DieHard test suite incorporates much 
of the analysis), so their original selling point is gone.
There is NO REASON to use a linear congruential RNG as the default any more.



More information about the Digitalmars-d mailing list