[net.unix-wizards] randomness

don@allegra.UUCP (D. Mitchell) (04/22/84)

My statement was not misleading.  "random()" as distributed, is very
poor.  While Mr. Cohen says he ran extensive checks, I found it badly
failed simple correlation tests.  I use my own generator (which I
posted) so I just forgot about it.  A few days later, Jim Reeds ran
some tests and actually predicted the bug on the basis of those test,
which we then found.  (That is, the use of a polynomial that was not
irreducible)

I would say with the bug fixed, random() is just fine.

If you want floating point numbers, I would recommend my frandom().  It
generates a full 56-bit random mantissa, and is therefore much better
(and much faster) than dividing an integer random number by
(double)2**31.

gwyn@BRL-VLD.ARPA (04/26/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@BRL-VLD.ARPA>

There are also the routines described in DRAND48(3C) (not available
on 4.2BSD as distributed).
	set $ANSWER=$<
to
	read ANSWER
There may be other bugs too but this should help.