Mail Archives: djgpp/2000/02/16/05:01:08
On 15 Feb 2000, Dieter Buerssner wrote:
> If the random() is used in default mode (rand_type = 3), random()
> seems to be a lagged Fibonacci RNG.
Yes.
> So, if you really need a good RNG, I would suggest to not
> use random(). You might want to do a net search on Marsaglia
> and Mersenne Twister.
`random' is actually quite good. It is better than `rand', and with
the single exception of the birthday test, it behaves quite well. It
might be not good enough for George Marsaglia, but I bet nobody else
will notice anything bad ;-)
Of course, if someone needs to write a multidimensional Monte-Carlo
simulation whose results will be used in safety-related applications,
then they had better used the best RNG they can get (and run their
program with several different RNGs to see the difference); these
applications *will* need the latest RNGs by Marsaglia. I had my
share of such programs, but I doubt if many people here will need
that.
> When rand_type = 0, BSD random produces very bad random numbers
> with an alternating least significant bit.
Yes, but you can only get to this mode if you hack the sources of
`random'.
- Raw text -