Yet another pseudo-random number generator

David Goodenough dg at lakart.UUCP
Mon Feb 13 06:58:53 AEST 1989


braner at batcomputer.tn.cornell.edu (Moshe Braner) sez:
> /*
>  *  The algorithm here is basically  x[i] = x[i-31]  EOR x[i-7].
>  *  (Could possibly improve by using x[i] = x[i-127] EOR x[i-63]?)
>  *  Each x[i] here is 32 bits wide, could also be 16 or whatever.
>  */

Sounds to me like you're running 16 or 32 LCG's in parallel. This
means that:

1. Individual bits will have all the problems associated with a LCG.

2. Supposing all your seed values have bit 7 == 0. You'll never ever
	get a 1 bit in bit 7. A somwhat remote possibility, but it
	could occur.

Comments anyone?
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com		  	  +---+



More information about the Comp.lang.c mailing list