gpu_rand/xoroshiro/
mod.rs

1//! Xoroshiro pseudorandom generators, Fast, fairly random, and small-state.
2//!
3//! # 64-bit generators
4//! - [`Xoshiro256StarStar`]: Recommended for all purposes. Excellent speed and
5//!   a state space (256 bits) large enough for any parallel application.
6//! - [`Xoshiro256PlusPlus`]: Recommended for all purposes. Excellent speed and
7//!   a state space (256 bits) large enough for any parallel application.
8//! - [`Xoshiro256Plus`]: Recommended for generating 64-bit floating-point
9//!   numbers. About 15% faster than `Xoshiro256StarStar`, but has a [low linear
10//!   complexity] in the lowest bits (which are discarded when generating
11//!   floats), making it fail linearity tests. This is unlikely to have any
12//!   impact in practice.
13//! - [`Xoroshiro128StarStar`]: An alternative to `Xoshiro256StarStar`, having
14//!   the same speed but using half the state. Only suited for low-scale parallel
15//!   applications.
16//! - [`Xoroshiro128PlusPlus`]: An alternative to `Xoshiro256PlusPlus`, having
17//!   the same speed but using half the state. Only suited for low-scale parallel
18//!   applications.
19//! - [`Xoroshiro128Plus`]: An alternative to `Xoshiro256Plus`, having the same
20//!   speed but using half the state. Only suited for low-scale parallel
21//!   applications. Has a [low linear complexity] in the lowest bits (which are
22//!   discarded when generating floats), making it fail linearity tests. This is
23//!   unlikely to have any impact in practice.
24//! - [`Xoshiro512StarStar`]: An alternative to `Xoshiro256StarStar` with more
25//!   state and the same speed.
26//! - [`Xoshiro512PlusPlus`]: An alternative to `Xoshiro256PlusPlus` with more
27//!   state and the same speed.
28//! - [`Xoshiro512Plus`]: An alternative to `Xoshiro512Plus` with more
29//!   state and the same speed. Has a [low linear complexity] in the lowest bits
30//!   (which are discarded when generating floats), making it fail linearity
31//!   tests. This is unlikely to have any impact in practice.
32//! - [`SplitMix64`]: Recommended for initializing generators of the xoshiro
33//!   familiy from a 64-bit seed. Used for implementing `seed_from_u64`.
34//!
35//! # 32-bit generators
36//! - [`Xoshiro128StarStar`]: Recommended for all purposes. Excellent speed.
37//! - [`Xoshiro128PlusPlus`]: Recommended for all purposes. Excellent speed.
38//! - [`Xoshiro128Plus`]: Recommended for generating 32-bit floating-point
39//!   numbers. Faster than `Xoshiro128StarStar`, but has a [low linear
40//!   complexity] in the lowest bits (which are discarded when generating
41//!   floats), making it fail linearity tests. This is unlikely to have any
42//!   impact in practice.
43//! - [`Xoroshiro64StarStar`]: An alternative to `Xoshiro128StarStar`, having
44//!   the same speed but using half the state.
45//! - [`Xoroshiro64Star`]: An alternative to `Xoshiro128Plus`, having the
46//!   same speed but using half the state. Has a [low linear complexity] in the
47//!   lowest bits (which are discarded when generating floats), making it fail
48//!   linearity tests. This is unlikely to have any impact in practice.
49//!
50//! The `*PlusPlus` generators perform similarily to the `*StarStar` generators.
51//! See the [xoshiro paper], where the differences are discussed in detail.
52//!
53//! [xoshiro]: http://xoshiro.di.unimi.it/
54//! [xoshiro paper]: http://vigna.di.unimi.it/ftp/papers/ScrambledLinear.pdf
55//! [low linear complexity]: http://xoshiro.di.unimi.it/lowcomp.php
56
57#[macro_use]
58mod common;
59mod splitmix64;
60mod xoroshiro128plus;
61mod xoroshiro128plusplus;
62mod xoroshiro128starstar;
63mod xoroshiro64star;
64mod xoroshiro64starstar;
65mod xoshiro128plus;
66mod xoshiro128plusplus;
67mod xoshiro128starstar;
68mod xoshiro256plus;
69mod xoshiro256plusplus;
70mod xoshiro256starstar;
71mod xoshiro512plus;
72mod xoshiro512plusplus;
73mod xoshiro512starstar;
74
75pub use common::Seed512;
76pub use rand_core;
77pub use splitmix64::SplitMix64;
78pub use xoroshiro128plus::Xoroshiro128Plus;
79pub use xoroshiro128plusplus::Xoroshiro128PlusPlus;
80pub use xoroshiro128starstar::Xoroshiro128StarStar;
81pub use xoroshiro64star::Xoroshiro64Star;
82pub use xoroshiro64starstar::Xoroshiro64StarStar;
83pub use xoshiro128plus::Xoshiro128Plus;
84pub use xoshiro128plusplus::Xoshiro128PlusPlus;
85pub use xoshiro128starstar::Xoshiro128StarStar;
86pub use xoshiro256plus::Xoshiro256Plus;
87pub use xoshiro256plusplus::Xoshiro256PlusPlus;
88pub use xoshiro256starstar::Xoshiro256StarStar;
89pub use xoshiro512plus::Xoshiro512Plus;
90pub use xoshiro512plusplus::Xoshiro512PlusPlus;
91pub use xoshiro512starstar::Xoshiro512StarStar;