Abstract
A collection of rng_engine
modules that implement the
Romu family of random number
generators by Mark Overton. While
the Romu generators are mostly fast on out-of-order CPUs because
they can be "zero latency" by fitting into otherwise unused
execution slots, they may also be useful on GPU. In particular,
the 32-bit variants run very fast.
As usual, the seeding, splitting, and joining functions are not part of the upstream Romu algorithm, but are simply best-effort implementations that try to mix in a little different entropy. Caveat emptor.
Synopsis
open import "lib/github.com/diku-dk/cpprandom/random" | ||
module romu_quad | : | rng_engine with int.t = u64 |
module romu_trio | : | rng_engine with int.t = u64 |
module romu_duo | : | rng_engine with int.t = u64 |
module romu_duo_jr | : | rng_engine with int.t = u64 |
module romu_quad32 | : | rng_engine with int.t = u32 |
module romu_trio32 | : | rng_engine with int.t = u32 |
module romu_mono32 | : | rng_engine with int.t = u16 |
Description
- ↑module romu_quad
More robust than anyone could need, but uses more registers than
romu_trio
.- Est. capacity: 2⁹⁰ bytes
- State size: 256 bits
- ↑module romu_trio
Great for general purpose work, including huge jobs.
- Est. capacity: 2⁷⁵ bytes
- State size: 192 bits
- ↑module romu_duo
Might be faster than
romu_trio
due to using fewer registers, but might struggle with massive jobs.- Est. capacity: 2⁶¹ bytes
- State size: 128 bits
- ↑module romu_duo_jr
The fastest generator using 64-bit arithmetic, but not suited for huge jobs.
- Est. capacity: 2⁵¹ bytes
- State size: 128 bits
- ↑module romu_quad32
32-bit arithmetic: Good for general purpose use.
- Est. capacity: 2⁶¹ bytes
- State size: 128
- ↑module romu_trio32
32-bit arithmetic: Good for general purpose use, except for huge jobs.
- Est. capacity: 2⁵³ bytes
- State size = 96 bits.
- ↑module romu_mono32
32-bit arithmetic: Suitable only up to 2²⁶ output-values. Outputs 16-bit numbers. Fixed period of (2³²)-47.
- Capacity: 2²⁷ bytes
- State size; 32 bits