Xoroshiro
This gem provides a port of the Xoroshiro256**
pseudo-random number generator (PRNG) to Ruby. Xoroshiro offers excellent
statistical performance and speed, matching or exceeding MT19937 (the PRNG
underpinning Ruby's built-in Random
class) in both categories.
Xoroshiro::rand
is intended as a drop-in replacement for Kernel::rand
, providing
the same behavior given the same arguments. Enumeration is also provided via :each
.
Timings on both MacOS and Windows show the gem's performance to be faster than
Kernel::rand
for generating both floating point and integer values—substantially
so for the latter. You can confirm this for yourself by running the xoroshiro_timings.rb
script provided in the gem's exe
folder.
Installation
Install the gem by executing:
$ gem install xoroshiro
License
The gem is available as open source under the terms of the MIT License.