<div dir="ltr"><div>I've released yet another non-cryptographic random number generator implementations for Erlang. These are still in the alpha phase, so bug reports and enhancements welcome.</div><div><br></div>xorshift+ and xorshift* pseudo random number generators (PRNGs) look promising as faster and more compact alternatives to Mersenne Twister PRNGs for 64-bit execution environments. Here are the implementations in Erlang without NIFs, with the MIT license:<div><br></div><div>xorshift+128 (exsplus)</div><div><a href="https://github.com/jj1bdx/exsplus/">https://github.com/jj1bdx/exsplus/</a><br><div><br></div><div>xorshift*64 (exs64)</div><div><a href="https://github.com/jj1bdx/exs64/">https://github.com/jj1bdx/exs64/</a><br></div><div><br></div><div>xorshift+128 and xorshift*64 both generate 64-bit integer sequences.</div><div><br></div><div>xorshift+128 has two 64-bit integers for the internal state, and the period is (2^127-1), the same as tinymt-erlang. The execution time of exsplus is ~x1.5 of tinymt-erlang (which generates 32-bit integer sequences) on OTP 17.3 with HiPE on OS X x86_64 and FreeBSD amd64 environments.<br></div></div><div><br></div><div>xorshift*64 has one 64-bit integer for the internal state, and the period is (2^64-1). The execution time of exs64 is roughly the same but slightly faster than exsplus.</div><div><br></div><div>Note: the random module algorithm (AS183), designed in 1980s, has only three 15-bit integers for the internal state, and the period is ~(2^43). </div><div><br></div><div>See <a href="http://xorshift.di.unimi.it/">http://xorshift.di.unimi.it/</a> for the further details of xorshift+ and xorshift* algorithms.</div><div><br></div><div>Regards,</div><div>Kenji Rikitake</div></div>