UniformBits (VSL_RNG_METHOD_UNIFORMBITS_STD)
A random number generator of uniform distribution that produces an integer (non-normalized to the interval (0, 1)) sequence. You can identify the underlying BRNG by passing the random stream descriptor
stream
as a parameter. Then
UniformBits
function calls integer implementation of this basic generator.
Basic generators differ in bit capacity and structure of the integer output, therefore you should interpret the output integer array of the function
viRngUniformBits
correctly. The following list provides rules for interpreting 32-bit integer output
r[i]
for each VS BRNG.
MCG31m1
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

R250
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

MRG32k3a
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

MCG59
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

WH
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

MT19937
Integer Recurrence







where

with

.


Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

MT2203
Integer Recurrence







where

with
,
.


Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

SFMT19937
Integer Recurrence

Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits
r
[i
] =
wi/4
(i
% 4)
SOBOL
Integer Recurrence


where


and
s
is the dimension of quasi-random vector.
Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

NIEDERR
Integer Recurrence


where


and
s
is the dimension of quasi-random vector.
Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

PHILOX4X32X10
Integer Recurrence
c
n
=
c
n-1
+ 1
w
n
=
f(c
n
)f(c)
is computed as follows:

k
0
0
=
k
0
k
1
0
=
k
1

f(c)
=

N
= 10
Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits
r
[i
] =
w
(i/4
i
% 4)
w
is the
i
(k)k
-th 32-bit integer in quadruple
w
,
n
k
= 0, 1, 2, 3
ARS5
Integer Recurrence
c
=
n
c
+ 1
n-1
w
=
n
f(c
n
)f(c)
is computed as follows:
c
0
=
c xor k
and
k
0
=
k
c
i+1
=
SubBytes(
c
)c
i+1
=
ShiftRows(
c
i+1
)c
i+1
=
MixColumns(
, omitted if
c
i+1
)i + 1 = N
c
i+1
=
AddRoundKey()
c
i+1
,k
j
Lo(k
i+1
)
=Lo(k
)
+ 0x9E3779B97F4A7C15
Hi(k
i+1
)
=
Hi(k
)
+ 0xBB67AE8584CAA73B
f(
c
) = c
,
N
N
= 5
Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits
r
[i
] =
w
(i/4
i
% 4)
w
is the
i
(k)k
-th 32-bit integer in quadruple
w
,
n
k
= 0, 1, 2, 3
NON-DETERMINISTIC
Integer Recurrence
Interpretation of 32-bit integer output array
r[i]
after calling
viRngUniformBits

- Lo(x)means obtaining lower 32 bits of the 64-bit unsigned integerx, that is,Lo(x) = xmod232.
- Hi(x)means obtaining upper 32 bits of the 64-bit unsigned integerx, that is,Hi(x) =⌊x/232⌋.
- ABCDmeans a 128-bit number composed of four 32-bit numbers A, B, C and D, that is
So, when you generate an integer sequence of
n
elements, the output array
r[i]
of the function
viRngUniformBits
comprises:
- nelements for the basic generators MCG31m1, R250, MRG32k3a, MT19937, MT2203, SOBOL, NIEDERR, Philox4x32-10 and ARS5.
- 2nelements for the basic generator MCG59.
- 4nelements for the basic generators WH and SFMT19937.
You may use the integer output, in particular, for fast generation of bit vectors. However, in this case some bits (or groups of them) might be non-random. For example, lower bits produced by linear congruential generators are less random than their higher bits. Note that quasi-random numbers are not random at all. Thoroughly check the integer output bits and bit groups for randomness before forming bit vectors from
r[i]
array.
See
Intel® oneAPI Math Kernel Library Vector Statistics Random Number Generator Performance Data for test results summary.