R250
This is a generalized feedback shift register generator:

Feedback shift register generators possess ample theoretical foundation and were initially intended for cryptographic and communication applications. Physicists widely use R250 generator, as it is simple and fast in implementation. However, this generator fails in some types of tests, one of which is the 2D Self-Avoiding Random Walk Test.
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
, x
1
, ...Stream Initialization by Function
vslNewStream
R250 generates the stream and initializes it specifying the input 32-bit integer parameter seed. The stream state is the array of 250 32-bit integers
x
-250
, x
-249
, x
-1
, initialized in the following way:- If seed = 0, assume seed = 1. Assumex-250= seed.
- Initializex-249, ...,x0according to recurrent correlationxn+1= 69069xn(mod232).
- Interpret the valuesx7,k-247k= 0, 1, ..., 31 as a binary matrix of size 32x32 and perform the following: set the diagonal bits to 1, and the under-diagonal bits to 0.
Stream Initialization by Function
vslNewStreamEx
R250 generates a stream and initializes it specifying the array
n
of 32-bit integer params[]
:- Ifn≥ 0, assume xk-250= params[k] ,k=0,1,...,249.
If
n
= 0, assume seed = 1, and perform the initialization as described in the above section on stream initialization by the function vslNewStream
.Subsequences Selection Methods
vslSkipAheadStream | Not supported |
vslSkipAheadStreamEx | Not supported |
vslLeapfrogStream | Not 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 | OK (0% errors) |
Bitstream Test | Not applicable | Not applicable | Not applicable | OK (25% errors) |
Rank of 31x31 Binary Matrices Test | Not applicable | Not applicable | Not applicable | OK (10% 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 (30% 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 (20% errors) |
Parking Lot Test | OK (0% errors) | OK (0% errors) | Not applicable | OK (0% errors) |
2D Self-Avoiding Random Walk Test | FAIL (70% errors) | FAIL (80% errors) | Not applicable | FAIL (80% errors) |
- 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].
- The stream tested is generated by calling the functionvslNewStreamwith seed=7,777,777.