Module peroxide::statistics::rand
source · Expand description
Random number generator
§Uniform random number generator
-
Peroxide uses external
rand
crate to generate random numberuse rand::prelude::*; fn main() { let mut rng = thread_rng(); let a = rng.gen_range(0f64..=1f64); // Generate random f64 number ranges from 0 to 1 }
-
To want more detailed explanation, see
rand
crate
§Piece-wise Rejection Sampling
Functions§
- Gaussian random number generator using Marsaglia polar form
- Piecewise Rejection Sampling
- Piecewise Rejection Sampling with specific Rng
- Simple uniform random number generator with ThreadRng
- Small random number generator from seed
- Std random number generator from seed
- Gaussian random numbers using the Ziggurat Method