Contents

# MCG59

This is a 59-bit multiplicative congruential generator:

Multiplicative congruential generator MCG59 is one of the two basic generators implemented in the NAG Numerical Libraries. As the module of the generator is not prime, the length of its period is not 2
59
but only 2
57
, if the initial value (seed) is not an even number. The drawback of these generators is well known, (see [Cram46], [Ent98]):
1. The lower bits of the generated sequence of pseudo-random numbers are not random and thus breaking numbers down into their bit patterns and using individual bits may cause failure of random tests.
2. Block-splitting an entire period sequence into 2d identical blocks leads to their full identity in d lower bits.
Real Implementation (Single and Double Precision)
The output vector is the sequence of the floating-point values
u
0
,
u
1
, ...
Integer Implementation
The output vector of the 32-bit integers is
x
0
mod2
32
, ⌊
x
0
/2
32
⌋,
x
1
mod2
32
, ⌊
x
1
/2
32
⌋, ...
Thus, the output vector stores practically every 59-bit member of the integer output as two 32-bit integers. For example, to get a vector from
n
59-bit integers the size of the output array should be large enough to store 2n 32-bit numbers.
Stream Initialization by Function
vslNewStream
MCG59 generates the stream and initializes it specifying the 32-bit input integer parameter seed.
1. Assume
x
0
= seed mod 2
59
.
2. If
x
0
= 0, assume
x
0
= 1.
Stream Initialization of Function
vslNewStreamEx
MCG59 generates the stream and initializes it specifying the the array
params[]
of
n
32-bit integers:
1. If
n
= 0, assume
x
0
= 1.
2. If
n
= 1, assume
seed = params[0]
, follow the instructions described in the above section on stream initialization by the function
vslNewStream
.
3. Otherwise assume
seed = params[0]+232*params[1]
, follow the instructions described in the above section on stream initialization by the function
vslNewStream
.
Subsequences Selection Methods
Generator Period
Lattice Structure
S
2
= 0.84;
S
3
= 0.73;
S
4
= 0.74;
S
5
= 0.58;
S
6
= 0.63;
S
7
= 0.52;
S
8
= 0.55;
S
9
= 0.56.
Empirical Testing Results Summary
Test Name
vsRngUniform
vdRngUniform
viRngUniform
viRngUniformBits
3D Spheres Test
OK (10% errors)
OK (10% errors)
Not applicable
OK (10% errors)
Birthday Spacing Test
Not applicable
Not applicable
Not applicable
OK (0% errors)[1]
Bitstream Test
Not applicable
Not applicable
Not applicable
OK (45% errors)
Rank of 31x31 Binary Matrices Test
Not applicable
Not applicable
Not applicable
OK (0% errors)[2]
Rank of 32x32 Binary Matrices Test
Not applicable
Not applicable
Not applicable
OK (0% errors)[3]
Rank of 6x8 Binary Matrices Test
Not applicable
Not applicable
Not applicable
OK (0% errors)[4]
Counts-the-1’s Test (stream of bits)
Not applicable
Not applicable
Not applicable
FAIL (100% errors)
Counts-the-1’s Test (stream of specific bytes)
Not applicable
Not applicable
Not applicable
OK (0% errors)[5]
Craps Test
OK (10% errors)
OK (10% errors)
OK (10% errors)
OK (10% errors)
Parking Lot Test
OK (20% errors)
OK (20% errors)
Not applicable
OK (20% errors)
2D Self-Avoiding Random Walk Test
OK (20% errors)
OK (10% errors)
Not applicable
OK (10% errors)
1. The tabulated data is obtained using the one-level (threshold) testing technique. The OK result indicates FAIL < 50%. The run fails when p-value falls outside the interval [0.05, 0.95].
2. The stream tested is generated by calling the function
vslNewStream
with seed=7,777,777.
[1] The generator fails the test for bit groups 0-23, 1-24, 2-25, 3-26, 5-28.
[2] The generator fails the test for bit groups 0-30, 1-31.
[3] The generator fails the test for bit groups 0-31, 1-32.
[4] The generator fails the test for bit groups 0-7, ..., 9-16, 11-18, 32-39, ..., 37-44, 39-46, ..., 41-48.
[5] The generator fails the test for bit groups 0-7, ..., 11-18, 13-20, ..., 15-22.

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.