Developer Reference

Contents

WH

This is a set of 273 Wichmann-Hill’s combined multiplicative congruential generators (
j
= 1, 2, ..., 273):
WH is a set of 273 different basic generators. This generator is the second basic generator in the NAG libraries. The constants
a
i,j
 range from 112 to 127, the constants
m
i,j
are prime numbers ranging from 16,718,909 to 16,776,971, close to 2
24
. These constants should show good results in the spectral test (see Knuth [Knuth81] and MacLaren [MacLaren89]). The period of each Wichmann-Hill generator may be equal to 2
92
if not for common factors between (
m
1
,j
-1), (
m
2
,j
-1), (
m
3
,j
-1) and (
m
4
,j
-1). However, each generator should still have a period of at least 2
80
. The generated pseudo-random sequences are essentially independent of one another according to the spectral test (for detailed information about properties of these generators see [MacLaren89]).
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 32-bit integers
x
0
,
y
0
,
z
0
,
w
0
,
x
1
,
y
1
,
z
1
,
w
1
Thus, the output vector stores practically every quadruple (
x, y, z, w
) of members of the integer output as four 32-bit integers. For example, to get a vector from n quadruples (
x, y, z, w
), the size of the output array should be large enough to store 4n 32-bit numbers.
Stream Initialization by Function
vslNewStream
WH generates the stream and initializes it specifying the 32-bit input integer parameter seed :
  1. Assume
    x
    0
    = seed mod m
    1
    . If
    x
    0
    = 0, assume
    x
    0
    = 1.
  2. Assume
    y
    0
    = 1,
    z
    0
    = 1,
    w
    0
    = 1.
The test selects a WH generator adding an offset to the named constant
VSL_BRNG_WH: VSL_BRNG_WH+0, VSL_BRNG_WH+1, ... , VSL_BRNG_WH+272
. The following example illustrates the initialization of the seventh (of 273) WH generator:
vslNewStream (&stream, VSL_BRNG_WH+6, seed);
Stream Initialization of Function
vslNewStreamEx
WH generates the stream and initializes it specifying the the array
params[]
of
n
32-bit integers:
  1. If
    n
    = 0, assume
    x
    0
    = 1,
    y
    0
    = 1,
    z
    0
    = 1,
    w
    0
    = 1.
  2. If
    n
    = 1, assume
    x
    0
    = params[0] mod m
    1
    ,
    y
    0
    = 1,
    z
    0
    = 1,
    w
    0
    = 1.
    If
    x
    0
    = 0, assume
    x
    0
    =1.
  3. If
    n
    = 2, assume
    x
    0
    = params[0] mod m
    1
    ,
    y
    0
    = params[1] mod m
    2
    ,
    z
    0
    = 1,
    w
    0
    = 1.
    If
    x
    0
    = 0, assume
    x
    0
    = 1.
    If
    y
    0
    = 0, assume
    y
    0
    = 1.
  4. If
    n
    = 3, assume
    x
    0
    = params[0] mod m
    1
    ,
    y
    0
    = params[1] mod m
    2
    ,
    z
    0
    = params[2] mod m
    3
    ,
    w
    0
    = 1.
    If
    x
    0
    = 0, assume
    x
    0
    = 1.
    If
    y
    0
    = 0, assume
    y
    0
    = 1.
    If
    z
    0
    = 0, assume
    z
    0
    = 1.
  5. If n ≥ 4, assume
    x
    0
    = params[0] mod m1,
    y
    0
    = params[1] mod m2,
    z
    0
    = params[2] mod m3,
    w
    0
    = params[3] mod m4.
    If
    x
    0 = 0, assume
    x
    0
    = 1.
    If
    y
    0
    = 0, assume
    y
    0
    = 1.
    If
    z
    0
    = 0, assume
    z
    0
    = 1.
    If
    w
    0
    = 0, assume
    w
    0
    = 1.
Subsequences Selection Methods
vslSkipAheadStream
Supported
vslSkipAheadStreamEx
Not supported
vslLeapfrogStream
Supported
Generator Period
Empirical Testing Results Summary
Test Name
vsRngUniform
vdRngUniform
viRngUniform
viRngUniformBits
3D Spheres Test
OK (0% errors) 
OK (0% errors) 
Not applicable 
OK (0% errors) 
Birthday Spacing Test
Not applicable
Not applicable
Not applicable
FAIL (60% errors) 
Bitstream Test
Not applicable
Not applicable
Not applicable
OK (10% errors) 
Rank of 31x31 Binary Matrices Test
Not applicable
Not applicable
Not applicable
N/A 
Rank of 32x32 Binary Matrices Test
Not applicable
Not applicable 
Not applicable
N/A 
Rank of 6x8 Binary Matrices Test
Not applicable
Not applicable
Not applicable
OK (0% errors)[6] 
Counts-the-1’s Test (stream of bits)
Not applicable
Not applicable
Not applicable
OK (10% errors)
Counts-the-1’s Test (stream of specific bytes)
Not applicable
Not applicable
Not applicable
OK (0% errors)
Craps Test
OK (20% errors)
OK (20% errors)
OK (20% errors)
OK (10% errors)
Parking Lot Test
OK (10% errors)
OK (10% errors)
Not applicable
OK (10% errors)
2D Self-Avoiding Random Walk Test
OK (10% errors)
OK (0% errors)
Not applicable
OK (20% 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.

Product and Performance Information

1

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