SFMT19937

This is a SIMD-oriented Fast Mersenne Twister pseudorandom number generator:

where w0, wM, wn-2, ... are 128-bit integers, and the wA, wB, wC, wD operations are defined as follows:

, left shift of 128-bit integer w by a followed by exclusive-or operation 

, right shift of each 32-bit integer in quadruple w followed by and-operation with quadruple of 32-bit masks mask,

mask=(0xBFFFFFF6 0xBFFAFFFF 0xDDFECB7F 0xDFFFFFFEF)

, right shift of 128-bit integer w

,  left shift of each 32-bit integer in quadruple w

Integer output: r4n+k = wn(k), where wn(k) is the k-th 32-bit integer in quadruple wn, k = 0, 1, 2, 3

un = (int)rn/232 + ½

Real Implementation (Single and Double Precision)

The output vector is the sequence of the floating-point values u0, u1, ... .

Integer Implementation

The output vector of 32-bit integers r0, r1...

Stream Initialization by Function vslNewStream

SFMT19937 generates the stream and initializes it specifying the input 32-bit unsigned integer parameter seed. The stream state, that is, the array of 156 128-bit integers (624 32-bit integers x0, ..., x623), is initialized by the procedure described in [Saito08] and based on the seed value.

Stream Initialization of Function vslNewStreamEx

SFMT19937 generates the stream and initializes it specifying the array params[] of n 32-bit unsigned integers:

  1. If n ≥ 1, perform initialization as described [Saito08] using array params[]on input.

  2. If n = 0, assume params[0] = 1, n = 1 and perform initialization as described in the previous item.

Subsequences Selection Methods

vslSkipAheadStream

Supported

vslLeapfrogStream

Not supported

vslSkipAheadStream

Supported

vslLeapfrogStream

Not supported

Skip-ahead method supported by SFMT19937 is based on algorithms described in [Haram08].

Generator Period

Empirical Testing Results Summary

Test Name

vsRngUniform

vdRngUniform

viRngUniform

viRngUniformBits

3D Spheres Test

OK (30% errors) 

OK (30% errors) 

Not applicable

OK (40% errors) 

Birthday Spacing Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Bitstream Test

Not applicable

Not applicable

Not applicable

OK (10% errors) 

Rank of 31x31 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Rank of 32x32 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Rank of 6x8 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

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 (30% errors) 

OK (30% errors) 

Not applicable

OK (0% errors) 

2D Self-Avoiding Random Walk Test

OK (0% errors) 

OK (20% errors) 

Not applicable

OK (10% errors) 

Test Name

vsRngUniform

vdRngUniform

viRngUniform

viRngUniformBits

3D Spheres Test

OK (30% errors) 

OK (30% errors) 

Not applicable

OK (40% errors) 

Birthday Spacing Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Bitstream Test

Not applicable

Not applicable

Not applicable

OK (10% errors) 

Rank of 31x31 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Rank of 32x32 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

Rank of 6x8 Binary Matrices Test

Not applicable

Not applicable

Not applicable

OK (0% errors) 

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 (30% errors) 

OK (30% errors) 

Not applicable

OK (0% errors) 

2D Self-Avoiding Random Walk Test

OK (0% errors) 

OK (20% errors) 

Not applicable

OK (10% errors) 

Note

  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.

For more complete information about compiler optimizations, see our Optimization Notice.
Select sticky button color: 
Orange (only for download buttons)