Contents

Basic Random Number Generators

Basic Random Number Generators (BRNG) are used to obtain random numbers of various statistical distributions. Non-uniform distribution generators depend on the quality of the underlying BRNGs. You should choose the BRNG depending on your application requirements, such as:
  1. quality requirements
  2. speed
  3. memory use
  4. efficient generation of random number subsequences
  5. using random numbers as real ones
  6. using random numbers as a bit stream
For example, a BRNG that cannot provide true randomness for lower bits is still applicable to applications using variates as real numbers.
VS provides a variety of BRNGs and permits you to register user-defined basic generators and use them in the same way as the BRNGs available with VS. You can also use random numbers generated externally, for example, from a physical source of random numbers [ Jun99 ]. This makes VS a general-purpose library suitable for various tasks. See Abstract Basic Random Number Generators. Abstract Streams section for details. 
Having several basic RNGs of different types available in VS also enables you to get more accurate verification results. Result verification is very important for computational experimentation. Typically, a researcher cannot verify the output since the solution is simply unknown. Any verification process involves testing of each structural element of the system. Being one of such structural elements, an RNG may produce inadequate results. To get more reliable results of the experiment, many authors recommend using several different BRNGs in a series of computational experiments.
VS provides the following basic pseudo-, quasi-, and non-deterministic random number generators:
BRNG
Type
Description
MCG31m1
pseudorandom
A 31-bit multiplicative congruential generator.
R250
pseudorandom
A generalized feedback shift register generator.
MRG32k3a
pseudorandom
A combined multiple recursive generator with two components of order 3.
MCG59
pseudorandom
A 59-bit multiplicative congruential generator.
WH
pseudorandom
A set of 273 Wichmann-Hill combined multiplicative congruential generators
(
j
= 1, 2, ... , 273 ).
MT19937
pseudorandom
Mersenne Twister pseudorandom number generator.
MT2203
pseudorandom
A set of 6024 Mersenne-Twister pseudorandom number generators
(
j
= 1,...,6024).
SFMT19937
pseudorandom
SIMD-oriented Fast Mersenne Twister pseudorandom number generator.
SOBOL (with Antonov-Saleev [ Ant79 ] modification)
quasi-random
A 32-bit Gray code-based generator producing low-discrepancy sequences for dimensions 1≤s≤40
NIEDERREITER (with Antonov-Saleev [ Ant79 ] modification)
quasi-random
A 32-bit Gray code-based generator producing low-discrepancy sequences for dimensions 1≤s≤318.
PHILOX4X32X10
pseudorandom
A Philox4x32-10 counter-based pseudorandom number generator.
ARS5
pseudorandom
A counter-based pseudorandom number generator, which uses instructions from the AES-NI set. Available in IA® architectures supporting this instruction set.
ABSTRACT
pseudorandom or quasi-random, depending on the user-provided settings
Abstract source of random numbers. See Abstract Basic Random Number Generators. Abstract Streams section for details. 
NON-DETERMINISTIC
Non-deterministic
[ BMT ], available in the latest CPUs such as [ AVX ].
BRNG
Type
Description
MCG31m1
pseudorandom
A 31-bit multiplicative congruential generator.
R250
pseudorandom
A generalized feedback shift register generator.
MRG32k3a
pseudorandom
A combined multiple recursive generator with two components of order 3.
MCG59
pseudorandom
A 59-bit multiplicative congruential generator.
WH
pseudorandom
A set of 273 Wichmann-Hill combined multiplicative congruential generators
(
j
= 1, 2, ... , 273 ).
MT19937
pseudorandom
Mersenne Twister pseudorandom number generator.
MT2203
pseudorandom
A set of 6024 Mersenne-Twister pseudorandom number generators
(
j
= 1,...,6024).
SFMT19937
pseudorandom
SIMD-oriented Fast Mersenne Twister pseudorandom number generator.
SOBOL (with Antonov-Saleev [ Ant79 ] modification)
quasi-random
A 32-bit Gray code-based generator producing low-discrepancy sequences for dimensions 1≤s≤40
NIEDERREITER (with Antonov-Saleev [ Ant79 ] modification)
quasi-random
A 32-bit Gray code-based generator producing low-discrepancy sequences for dimensions 1≤s≤318.
PHILOX4X32X10
pseudorandom
A Philox4x32-10 counter-based pseudorandom number generator.
ARS5
pseudorandom
A counter-based pseudorandom number generator, which uses instructions from the AES-NI set. Available in IA® architectures supporting this instruction set.
ABSTRACT
pseudorandom or quasi-random, depending on the user-provided settings
Abstract source of random numbers. See Abstract Basic Random Number Generators. Abstract Streams section for details. 
NON-DETERMINISTIC
Non-deterministic
[ BMT ], available in the latest CPUs such as [ AVX ].
Each VS basic generator consists of the following subroutines:
  1. Stream Initialization Subroutine. See section Random Streams and RNGs in Parallel Computation for details.
  2. Integer Output Generation Subroutine. Every generated integral value (within certain bounds) may be considered a random bit vector. For details on randomness of individual bits or bit groups, see Basic Random Generator Properties and Testing Results .
  3. Single Precision Floating-Point Random Number Vector Generation Subroutine. The subroutine generates a real arithmetic vector of uniform distribution over the interval [
    a, b
    ).
  4. Double Precision Floating-Point Random Number Vector Generation Subroutine. The subroutine generates a real arithmetic vector of uniform distribution over the interval [
    a, b
    ).
The sections below discuss each basic generator in more detail and provide references for further reading.
MCG31m1
32-bit linear congruential generators including MCG31m1 [ L'Ecuyer99 ] are still used as the default RNGs in various systems because of the simplicity of implementation, speed of operation, and compatibility with earlier versions of the systems. However, their period lengths do not meet the requirements for modern BRNGs. Nevertheless, MCG31m1 has good statistical properties and may provide optimal results in generating random numbers of various distribution types for relatively small samplings.
R250
R250 is a generalized feedback shift register generator. Feedback shift register generators have extensive theoretical footing and were first considered as RNGs for cryptographic and communications applications. Generator R250 proposed in [ Kirk81 ] is fast and simple in implementation and is commonly used in the field of physics. However, the generator fails a number of tests, for example, a 2D self-avoiding random walk [ Ziff98 ].
MRG32k3a
A combined generator MRG32k3a [ L'Ecu99 ] meets the requirements for modern RNGs, such as good multidimensional uniformity or a fairly large period. Being optimized for various Intel® architectures, this generator rivals other VS basic RNGs in speed.
MCG59
A multiplicative congruential generator MCG59 is one of the two basic generators implemented in Numerical Algorithms Group (NAG) Numerical Libraries [ NAG ]. Since the module of this generator is not prime, its period length is 2
57
instead of 2
59
, if the seed is an odd number. The drawback of such generators is that the lower bits of the output sequence are not random, therefore breaking numbers down into their bit patterns and using individual bits may be error-prone. For example, see [ Knuth81 ], [ L'Ecu94 ]. Besides, block-splitting of the sequence over the entire period into 2D similar blocks results in full coincidence of such blocks in d lower bits. For example, see [ Knuth81 ], [ L'Ecu94 ].
WH
Wichmann-Hill (WH) is a set of 273 different BRNGs. It is the second BRNG in NAG libraries. The constants
ai,j
are in the range from 112 to 127 and the constants
mi,j
are prime numbers in the range from 16718909 to 16776971, which are close to 2
24
. These constants have been chosen so that they give good results with the spectral test, see [ Knuth81 ] and [ MacLaren89 ]. The period of each WH generator should be at least 2
92
, but it is affected by common factors between (
m
1,
j
- 1), (
m
2,
j
- 1), (
m
3,
j
- 1), and (
m
4,
j
- 1). Still, each generator should have a period of at least 2
80
. Further discussion of the properties of these generators is given in [ MacLaren89 ], which shows that the generated pseudorandom sequences are essentially independent of one another according to the spectral test.
Note
The variables
xn, yn, zn, wn
in the above equations define a successive member of integer subsequence set by recursion. The variable
un
is the generator real output normalized to the interval (0, 1).

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804