inlined nearly divisionless random numbers

from blog Tony Finch's blog, | ↗ original
a blog post for international RNG day Lemire’s nearly-divisionless algorithm unbiased bounded random numbers has a fast path and a slow path. In the fast path it gets a random number, does a multiplication, and a comparison. In the rarely-taken slow path, it calculates a remainder (the division) and enters a rejection sampling loop. When Lemire’s...