![]() |
ANSIC is the generator employed by the ANSI C rand() function, BSD
version. Note that some versions of the unix online-manual incorrectly
claim this generator's period to be
.
| 0.84 | 0.52 | 0.63 | 0.49 | 0.68 | 0.43 | 0.54 |
) which is
far too slow and by a feedback generator random of the type
![]() |
Quote[200]: First suggested by Lewis, Goodman, and Miller in 1969 [155] ( based largely on the fact that this generator is a full period generator) , this generator has in subsequent years passed all new theoretical tests, and (perhaps more importantly) has accumulated a large amount of successful use. Park and Miller[189] do not claim that the generator is ``perfect'' (we will see below that it is not), but only that it is a good minimal standard against which other generators should be judged.
Quote[189]: Our guess is that at some future point we will
switch to either
or
. This choice will lead to better
spectral test LCGs (see below).
| 16807 | 0.3375 | 0.4412 | 0.5752 | 0.7361 | 0.6454 | 0.5711 | 0.6096 |
| 48271 | 0.8960 | 0.8269 | 0.8506 | 0.7332 | 0.8078 | 0.5865 | 0.4364 |
| 69621 | 0.7836 | 0.9205 | 0.8516 | 0.7318 | 0.7667 | 0.6628 | 0.7845 |
![]() |
Quote[189]: Many multiplicative linear congruential generators are descendants of the infamous RANDU ( System/360 Scientific Subroutine Package, Version III, Programmer's Manual. IBM, White Plains, New York, 1968, p. 77.). This generator was first introduced in the early 1960s; its use soon became widespread ( examples are given ) . In retrospect RANDU was a mistake. The non-prime modulus was selected to facilitate the mod operation and the multiplier was selected primarily because of the simplicity of its binary representation. Research and experience has now made it clear that RANDU represents a flawed generator with no significant redeeming features. It does not have a full period and it has some distinctly non-random characteristics. Knuth calls it ``really horrible'' [126, p. 173].
| 0.93 | 0.012 | 0.059 | 0.16 | 0.29 | 0.45 | 0.62 |
![]() |
Implemented in the SIMSCRIPT II and INSIGHT simulation programming language and employed by the FORTRAN RAN function [37]. For references, implementations, empirical tests, execution times and lattice tests see [12,17,24,37,74,75,73,91,104,118,128,130,131,133,139,140,146,145,137,130,160,169,171,193,192,202,203]. Source codes in FORTRAN, Pascal and C, which support seed management in order to provide disjoint streams of random numbers, are given in [130, Sect. 7.6].
Note that
.
Quote [192]: Lehmer [153,226] suggested
(a prime Mersenne number).
Fourteen was chosen because it is a primitive root modulo
;
a multiplicative group of order
(cycle length) was generated.
Raising 14 to the
-th power where
is relatively prime to the cycle length
gives another primitive root modulo
. Choosing
introduces
``randomness'' into the number sequence.
Spectral test for dim.
:
| 0.82 | 0.43 | 0.78 | 0.80 | 0.57 | 0.68 | 0.72 |
![]() |
Quote [8]: This generator comes from Knuth [126, p. 102] and is contained in the totally portable random number generator HSRPUN from BCSLIB (Boeing Computer Services). The age of this generator is apparent from its modulus, which dates back to the days of 36-bit computers (e.g. implemented on UNIVAC machines [130, p. 428]).
The multiplicative versions
is implemented in the programming language SIMULA, and the version with
modulus
on CDC computers [107] [25, V104].
In [16] a
version with modulus
is tested in different parallel settings
(see also Sect.
).
Empirical and theoretical tests of these generators are given
in [8,36,46,42,85,107].
Spectral test for dimensions
:
| LCG | 3 | 4 | 5 | 6 | 7 | 8 | |
|
|
0.7460 | 0.8784 | 0.7995 | 0.4851 | 0.6919 | 0.5233 | 0.6934 |
|
|
0.5809 | 0.4145 | 0.8004 | 0.6401 | 0.6951 | 0.6379 | 0.7473 |
|
|
0.6794 | 0.6248 | 0.6158 | 0.5512 | 0.4588 | 0.6416 | 0.7309 |
|
|
0.9599 | 0.5761 | 0.5178 | 0.4799 | 0.6001 | 0.6956 | 0.6715 |
![]() |
This generator corresponds to the URN12 (URN11) generator in
[51,118].
The latter books contain empirical tests and implementations. Note that
where
is the multiplier of
BCSLIB. Further empirical results
are given in [12,52,140,137,146,145].
Quote [51]: This generator was for example used in the CUPL language (ref. given) and was studied by Coveyou and MacPherson [36].
Spectral test for dim.
:
| 0.766 | 0.772 | 0.490 | 0.398 | 0.705 | 0.635 | 0.436 |
![]() |
Implemented on Apple Computers [118,110,216].
Spectral test for dimensions
and different moduli
:
| 3 | 4 | 5 | 6 | 7 | 8 | ||
| 0.7930 | 0.7431 | 0.6291 | 0.6531 | 0.5689 | 0.7445 | 0.5946 | |
| 0.7764 | 0.5195 | 0.5498 | 0.6873 | 0.6321 | 0.4211 | 0.5981 | |
| 0.4746 | 0.3715 | 0.6376 | 0.6124 | 0.7416 | 0.6781 | 0.7473 | |
| 0.9142 | 0.2953 | 0.4650 | 0.5498 | 0.6443 | 0.6482 | 0.6395 | |
| 0.5714 | 0.6665 | 0.5530 | 0.6178 | 0.5913 | 0.5964 | 0.5821 |
Quote:[126, p. 104] The generators (with multiplier
and
(BCSLIB) ) are reminders of the good old days - they were
once used extensively since O. Taussky first suggested them in the early 1950s
(see also [109,153,212]).
Better spectral test results exhibits a LCG with the same multiplier but
with modulus
[163],
[171] or
. The latter version is implemented in the simulation
language SIMULA for BS 2000. Empirical results for different moduli
are given in [12,109]. Jansson [109] used modulus
.
![]() |
This generator, proposed by George Marsaglia [163,168,165], is part of a combined Generator called SUPER-DUPER5 (combined with a shift-register generator).
Quote [163]: As a candidate for the best of
all multipliers, I nominate 69069
.
This palindromically convoluted multiplier
is easy to remember and has a nearly cubic lattice for moduli
,
,
. Super-Duper was sometimes implemented in
the form
, see [85, p. 89] and
[118,233].
Spectral test for dimensions
and different moduli:
| 0.4625 | 0.3131 | 0.4572 | 0.5529 | 0.3767 | 0.4967 | 0.6852 | |
| 0.6935 | 0.8595 | 0.6347 | 0.7000 | 0.2664 | 0.3690 | 0.5284 | |
| 0.4904 | 0.6822 | 0.7760 | 0.6094 | 0.4746 | 0.3342 | 0.4845 |
The version
yields ``better'' spectral test
results (The spectral test results of this version are given in [8],
instead of the original).
The exact discrepancy calculation for overlapping tuples in
dimension 2 has been carried out in [5].
For the versions with modulus
and
critical distances are given in [42].
Super-Duper exhibits rather bad splitting properties, see
Section
.
![]() |
These are the best spectral and lattice test multipliers from a study of
Hoaglin [99]. Theoretical and empirical tests are given in
[12,51,74,99,104,118,193]
and implementations in [51]. For implementations of multiplier
397204094 (SAS and IMSL Library) and its
theoretical and empirical results see [75,79,130,179,227].
Fishman[75, p. 40] writes: Our top five multipliers do not
dominate
(respectively discrepancy bounds)
and
(SIMSCRIPT) unambiguously, as in the earlier tables. This lack of
discrimination on the part of the lower bounds on discrepancy may be due to
the fact that discrepancy is not a rotation invariant measure.
Spectral tests for dim.
:
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
| 1078318381 | 0.9442 | 0.6790 | 0.6684 | 0.7137 | 0.7252 | 0.6482 | 0.6265 |
| 1203248318 | 0.9086 | 0.8673 | 0.8092 | 0.6997 | 0.6389 | 0.6324 | 0.6695 |
| 397204094 | 0.5564 | 0.5748 | 0.6674 | 0.7678 | 0.5947 | 0.5815 | 0.7181 |
| 2027812808 | 0.6883 | 0.6012 | 0.7059 | 0.6976 | 0.6356 | 0.7432 | 0.6917 |
| 1323257245 | 0.7298 | 0.6106 | 0.6715 | 0.7393 | 0.6389 | 0.6726 | 0.6430 |
| 764261123 | 0.7309 | 0.7081 | 0.7153 | 0.7710 | 0.6887 | 0.6143 | 0.6484 |
![]() |
The parameters
in the table below determine the
top five generators respectively
in an
exhaustive analysis of multiplicative congruential random number generators
made by Fishman and Moore [72,73,75].
Quote [75]: Here a multiplier is said to be optimal if the
distance between adjacent parallel hyperplanes on which
-tuples lie does not
exceed the minimal achievable distance by more than 25 percent for
. This means that the spectral test values are greater than
0.8 (see the table below and for the first two generators see also
[104,131]).
Further references and empirical results for Fishman-LCGs
(mainly for generator 1 and 2)
can be found in
[67,69,68,70,85,87,91,92,89,103,107,112,117,150,133,140,137,146,145,151,156,171,193,234].
Generator 1 and 6 are used in
[102] and [101] to study transformation methods for non-uniform
variates. An implementation is given in [105]. Generator 1 is
implemented in the simulation language GPSS/H
[130,139,157,169,207].
| no. | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||
| 1 | 742938285 | 0.8672 | 0.8607 | 0.8627 | 0.8319 | 0.834 | 0.6239 | 0.7067 | |
| 2 | 950706376 | 0.857 | 0.8985 | 0.8691 | 0.8337 | 0.8274 | 0.5916 | 0.5981 | |
| 3 | 1226874159 | 0.8411 | 0.8787 | 0.8255 | 0.8378 | 0.8444 | 0.6277 | 0.5981 | |
| 4 | 62089911 | 0.8930 | 0.8903 | 0.8575 | 0.8630 | 0.8249 | 0.7622 | 0.6020 | |
| 5 | 1343714438 | 0.8236 | 0.8324 | 0.8245 | 0.8262 | 0.8254 | 0.7440 | 0.4915 | |
| no. | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||
| 6 | 1099087573 | 0.8920 | 0.8563 | 0.8603 | 0.8420 | 0.8325 | 0.5547 | 0.7506 | |
| 7 | 2396548189 | 0.8571 | 0.9238 | 0.8316 | 0.8248 | 0.8247 | 0.6664 | 0.709 | |
| 8 | 2824527309 | 0.9220 | 0.8235 | 0.850 | 0.8451 | 0.8332 | 0.6983 | 0.5512 | |
| 9 | 3934873077 | 0.8675 | 0.8287 | 0.8278 | 0.8361 | 0.8212 | 0.7188 | 0.7616 | |
| 10 | 392314069 | 0.9095 | 0.8292 | 0.8536 | 0.8489 | 0.8198 | 0.6047 | 0.6084 | |
| no. | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||
| 11 | 68909602460261 | 0.8253 | 0.8579 | 0.8222 | 0.8492 | 0.8230 | 0.6971 | 0.5275 | |
| 12 | 33952834046453 | 0.9282 | 0.8476 | 0.8575 | 0.8353 | 0.8215 | 0.5289 | 0.6383 | |
| 13 | 43272750451645 | 0.8368 | 0.8262 | 0.8230 | 0.8400 | 0.8213 | 0.5993 | 0.6171 | |
| 14 | 127107890972165 | 0.8531 | 0.8193 | 0.8216 | 0.8495 | 0.8224 | 0.4504 | 0.5934 | |
| 15 | 55151000561141 | 0.9246 | 0.8170 | 0.9240 | 0.8278 | 0.8394 | 0.6274 | 0.4471 |
A list of 30 LCGs including RANDU, BCSLIB, APPLE, Super-Duper, DERIVE, and
their spectral tests is given in
Knuth
[126]. These LCGs have been
selected according to various criteria (``random'' multiplier,
multiplier that guarantee fast implementations, multiplier close to power of
two which produce bad lattice structures [73,126,181] ).
Some of them
stem from a search for optimal multipliers with respect to
two-dimensional discrepancy made by Borosh and
Niederreiter
Niederreiter
[15].
Empirical and theoretical results of these generators can be found in
[69,42,73,101,102,196,227,228].
The spectral tests in
dimensions
of some Borosh and Niederreiter's LCGs
[15, Table 2] are given in the table below. Note that
the spectral tests in dimension 2 perform excellent but as one may
guess in higher dimensions some bad values occur.
An extension of Borosh and Niederreiter`s search to prime moduli
is given in [21].
Note that the generators, obtained by the latter study, behave satisfactory
in the spectral test in higher dimensions as well.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Using the spectral test, Anderson [8]
made a search for good multipliers for multiplicative LCGs with
modulus
.
Different to Fishman [72] who did an exhaustive search,
Anderson used a LCG (see Sect.
) to perform a partial search over
multiplier
. In the table below we give the list of
20 ``acceptable'' (
,
)
multiplier with their spectral tests. The search of Anderson
was extended by Masuda and Zimmerman [171]. They got
1615 multiplier for modulus
and 527 for
.
Both searches were motivated in order to obtain LCGs
for use in parallel environments.
|
![]() |
Email(From swh@aloha.com Mar 14 1996): The DERIVE random number generator maintains a random integer in the
interval
to calculate user requested random integers in a given
range. Given a random integer n, the next random integer is generated by the
formula MOD (3141592653*n + 1,
). Information:
Soft Warehouse, Inc. (the authors of DERIVE, A Mathematical Assistant),
3660 Waialae Avenue, Suite 304
Honolulu, HI 96816-3236 U.S.A.
http://www.derive.com
The multiplier probably stems from Knuth [126, p. 32,44,102],
who studied
,
(note that the
digits of the multiplier equal the first digits of
in its decimal
representation).
Quote:[126, p. 103] The latter LCG shows a ``random''
multiplier; this generator has satisfactorily passed numerous empirical tests
for randomness, but it does not have especially good spectral test values
for dimensions
.
Empirical results from DERIVE are given in [227].
Ripley [203] quotes
a similar multiplier
which was used on Atari ST machines.
Further ``related'' generators are
from [208] (see also Sect. A)
and
, 314159269, 453806245, 0) which was
proposed in [127, p. 240] (quote from [130]).
The latter multiplier is also mentioned in [165, make.txt].
Anderson [8] used
, 3141592653, 2718281, 1) to perform a random search for
good multiplier with respect to the spectral test for multiplicative LCGs
with modulus
(see also [171]).
The table below presents spectral tests for DERIVE with different moduli
(observe the poor result for
in dimension
):
| 0.0972 | 0.5551 | 0.5479 | 0.3216 | 0.6426 | 0.5210 | 0.6731 | |
| 0.2749 | 0.2776 | 0.3258 | 0.2122 | 0.4544 | 0.6721 | 0.6984 | |
| 0.4073 | 0.4604 | 0.3966 | 0.3599 | 0.4786 | 0.7039 | 0.6357 |
This section contains further LCGs implemented in different software or some of which are mentioned in the literature.