Documentation
¶
Overview ¶
Package xoshiro provides an implementation for a pseudo-random number generator (PRNG) using the xoshiro256** and xoshiro256+ algorithms.
Period: 2^256-1. State size: 256 bits.
Go implementation based on a C reference implementation by David Blackman and Sebastiano Vigna. For further information: http://xoshiro.di.unimi.it/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rng256P ¶
type Rng256P [4]uint64
Rng256P encapsulates a xoshiro256+ PRNG.
xoshiro256+ 1.0 is Blackman & Vigna's best and fastest generator for floating-point numbers. The authors suggest to use its upper bits for floating-point generation, as it is slightly faster than xoshiro256**. It passes all tests the authors are aware of except for the lowest three bits, which might fail linearity tests (and just those), so if low linear complexity is not considered an issue (as it is usually the case) it can be used to generate 64-bit outputs, too.
The authors suggest to use a sign test to extract a random Boolean value, and right shifts to extract subsets of bits.
Note that the Go implementation of Rand.Float64 uses the upper bits as suggested.
type Rng256SS ¶
type Rng256SS [4]uint64
Rng256SS encapsulates a xoshiro256** PRNG.
xoshiro256** 1.0 is Black,an & Vigna's all-purpose, rock-solid generator. It has excellent (sub-ns) speed, a state (256 bits) that is large enough for any parallel application, and it passes all tests the authors are aware of.
For generating just floating-point numbers, xoshiro256+ is even faster.