Basic HTML version of Foils prepared 21 October 1995

Foil 12 Simple Random Number Generator

From CPS615 Foils -- set D:Statistics and Random Numbers CPS615 Basic Simulation Track for Computational Science -- Fall Semester 95. by Geoffrey C. Fox


Take the choice:
m = 231
a = 1103515245
c = 12345
Implemented in C as (64 bit)
newran = [a*oldran+c] & MASK
floatran = newran/2147483648.0
oldran = newran
floatran is uniformly distributed in [0,1]
MASK has lower 31 bits = 1and all higher bits = 0
This intuitively says that lower order bits of a complex multiplication are "essentially" random



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed May 13 1998