<s>
A	O
permuted	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
(	O
PCG	O
)	O
is	O
a	O
pseudorandom	B-Algorithm
number	I-Algorithm
generation	I-Algorithm
algorithm	O
developed	O
in	O
2014	O
by	O
Dr.	O
M.E.	O
</s>
<s>
O'Neill	O
which	O
applies	O
an	O
output	O
permutation	B-Algorithm
function	O
to	O
improve	O
the	O
statistical	O
properties	O
of	O
a	O
modulo-2n	O
linear	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
.	O
</s>
<s>
A	O
PCG	O
differs	O
from	O
a	O
classical	O
linear	B-Algorithm
congruential	I-Algorithm
generator	I-Algorithm
(	O
LCG	B-Algorithm
)	O
in	O
three	O
ways	O
:	O
</s>
<s>
the	O
LCG	B-Algorithm
modulus	O
and	O
state	O
is	O
larger	O
,	O
usually	O
twice	O
the	O
size	O
of	O
the	O
desired	O
output	O
,	O
</s>
<s>
It	O
is	O
the	O
variable	O
rotation	O
which	O
eliminates	O
the	O
problem	O
of	O
a	O
short	O
period	O
in	O
the	O
low-order	O
bits	O
that	O
power-of-2	O
LCGs	B-Algorithm
suffer	O
from	O
.	O
</s>
<s>
The	O
core	O
LCG	B-Algorithm
is	O
defined	O
for	O
widths	O
from	O
8	O
to	O
128	O
bits	O
,	O
although	O
only	O
64	O
and	O
128	O
bits	O
are	O
recommended	O
for	O
practical	O
use	O
;	O
smaller	O
sizes	O
are	O
for	O
statistical	O
tests	O
of	O
the	O
technique	O
.	O
</s>
<s>
The	O
additive	O
constant	O
in	O
the	O
LCG	B-Algorithm
can	O
be	O
varied	O
to	O
produce	O
different	O
streams	O
.	O
</s>
<s>
The	O
constant	O
is	O
an	O
arbitrary	O
odd	O
integer	O
,	O
so	O
it	O
does	O
not	O
need	O
to	O
be	O
stored	O
explicitly	O
;	O
the	O
address	B-General_Concept
of	O
the	O
state	O
variable	O
itself	O
(	O
with	O
the	O
low	O
bit	O
set	O
)	O
can	O
be	O
used	O
.	O
</s>
<s>
XSH	O
:	O
An	O
xorshift	B-Algorithm
operation	O
,	O
x	O
^	O
=	O
x	O
>>	O
constant	O
.	O
</s>
<s>
XSL	O
:	O
A	O
simplified	O
version	O
of	O
xorshift	B-Algorithm
,	O
folding	O
the	O
value	O
in	O
half	O
by	O
XORing	O
the	O
high	O
half	O
into	O
the	O
low	O
.	O
</s>
<s>
RXS	O
:	O
An	O
xorshift	B-Algorithm
by	O
a	O
random	O
(	O
input-dependent	O
)	O
amount	O
.	O
</s>
<s>
XSH-RR	O
:	O
An	O
xorshift	B-Algorithm
mixes	O
some	O
high-order	O
bits	O
down	O
,	O
then	O
bits	O
63	O
–	O
59	O
select	O
a	O
rotate	O
amount	O
to	O
be	O
applied	O
to	O
bits	O
27	O
–	O
58	O
.	O
</s>
<s>
Each	O
step	O
of	O
these	O
output	O
transformations	O
is	O
either	O
invertible	O
(	O
and	O
thus	O
one-to-one	B-Algorithm
)	O
or	O
a	O
truncation	O
,	O
so	O
their	O
composition	B-Application
maps	O
the	O
same	O
fixed	O
number	O
of	O
input	O
states	O
to	O
each	O
output	O
value	O
.	O
</s>
<s>
This	O
preserves	O
the	O
equidistribution	O
of	O
the	O
underlying	O
LCG	B-Algorithm
.	O
</s>
<s>
The	O
generator	O
applies	O
the	O
output	O
transformation	O
to	O
the	O
initial	O
state	O
rather	O
than	O
the	O
final	O
state	O
in	O
order	O
to	O
increase	O
the	O
available	O
instruction-level	B-Operating_System
parallelism	I-Operating_System
to	O
maximize	O
performance	O
on	O
modern	O
superscalar	B-General_Concept
processors	I-General_Concept
.	O
</s>
<s>
A	O
slightly	O
faster	O
version	O
eliminates	O
the	O
increment	O
,	O
reducing	O
the	O
LCG	B-Algorithm
to	O
a	O
multiplicative	O
(	O
Lehmer-style	O
)	O
generator	O
with	O
a	O
period	O
of	O
only	O
262	O
,	O
and	O
uses	O
the	O
weaker	O
XSH-RS	O
output	O
function	O
:	O
</s>
<s>
TestU01	B-Algorithm
's	I-Algorithm
BigCrush	O
examines	O
enough	O
data	O
to	O
detect	O
a	O
period	O
of	O
235	O
,	O
so	O
even	O
an	O
ideal	O
generator	O
requires	O
36	O
bits	O
of	O
state	O
to	O
pass	O
it	O
.	O
</s>
<s>
For	O
comparison	O
,	O
xorshift*	O
,	O
one	O
of	O
the	O
best	O
of	O
the	O
alternatives	O
,	O
requires	O
40	O
bits	O
of	O
state	O
,	O
and	O
Mersenne	B-Algorithm
twister	I-Algorithm
fails	O
despite	O
19937	O
bits	O
of	O
state	O
.	O
</s>
