#generator #numbers #rng #state #splitmix64 #xoroshiro #implemented

deprecated xoshiro

Xoshiro, xoroshiro and splitmix64 random number generators

5 releases

Uses old Rust 2015

0.0.5 Jan 14, 2019
0.0.4 Sep 11, 2018
0.0.3 Jul 18, 2018
0.0.2 Jun 26, 2018
0.0.1 Jun 12, 2018

#110 in #rng

Download history 18/week @ 2024-03-13 10/week @ 2024-03-27 20/week @ 2024-04-03 9/week @ 2024-04-24 181/week @ 2024-05-01 118/week @ 2024-05-08 1081/week @ 2024-05-15 359/week @ 2024-05-22 635/week @ 2024-05-29 154/week @ 2024-06-05 874/week @ 2024-06-12 642/week @ 2024-06-19 133/week @ 2024-06-26

1,827 downloads per month
Used in 2 crates

MIT/Apache

52KB
1K SLoC

xoshiro

The crate is deprecated in favor of the rand_xoshiro crate.

Status

Rust implementation of the xoshiro, xoroshiro and splitmix64 random number generators.

License

xoshiro is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, and LICENSE-MIT for details.


lib.rs:

This crate implements the xoshiro family of pseudorandom number generators designed by David Blackman and Sebastiano Vigna. They feature high perfomance and a small state and superseed the previous xorshift-based generators. However, they are no cryptographically secure and their output can be predicted by observing a few samples.

The following generators are implemented:

64-bit generators

  • Xoshiro256StarStar: Recommended for all purposes. Excellent speed and a state space (256 bits) large enough for any parallel application.
  • Xoshiro256Plus: Recommended for generating 64-bit floating-point numbers. About 15% faster than Xoshiro256StarStar, but has a low linear complexity in the lowest bits (which are discarded when generating floats), making it fail linearity tests. This is unlikely to have any impact in practise.
  • Xoroshiro128StarStar: An alternative to Xoshiro256StarStar, having the same speed but using half the state. Only suited for low-scale parallel applications.
  • Xoroshiro128Plus: An alternative to Xoshiro256Plus, having the same speed but using half the state. Only suited for low-scale parallel applications. Has a low linear complexity in the lowest bits (which are discarded when generating floats), making it fail linearity tests. This is unlikely to have any impact in practise.
  • Xoshiro512StarStar: An alternative to Xoshiro256StarStar with more state and the same speed.
  • Xoshiro512Plus: An alternative to Xoshiro512Plus with more state and the same speed. Has a low linear complexity in the lowest bits (which are discarded when generating floats), making it fail linearity tests. This is unlikely to have any impact in practise.
  • SplitMix64: Recommended for initializing generators of the xoshiro familiy from a 64-bit seed. Used for implementing seed_from_u64.

32-bit generators

  • Xoshiro128StarStar: Recommended for all purposes. Excellent speed.
  • Xoshiro128Plus: Recommended for generating 32-bit floating-point numbers. Faster than Xoshiro128StarStar, but has a low linear complexity in the lowest bits (which are discarded when generating floats), making it fail linearity tests. This is unlikely to have any impact in practise.
  • Xoroshiro64StarStar: An alternative to Xoshiro128StarStar, having the same speed but using half the state.
  • Xoroshiro64Star: An alternative to Xoshiro128Plus, having the same speed but using half the state. Has a low linear complexity in the lowest bits (which are discarded when generating floats), making it fail linearity tests. This is unlikely to have any impact in practise.

Dependencies

~180KB