[erlang-questions] RNG algorithm choice for uniform natural numbers

Richard O'Keefe raoknz@REDACTED
Thu Aug 2 19:49:39 CEST 2018


a "uniform sequence of natural numbers".  There are infinitely many natural
numbers.  The generators you mention
produce integers of fixed size.  What exactly is it you want?   Do you want
something like
https://gmplib.org/manual/Integer-Random-Numbers.html ?

On 3 August 2018 at 00:19, Krzysztof Jurewicz <krzysztof.jurewicz@REDACTED>
wrote:

> I’m looking for an algorithm to perform a transparent, reproducible
> generation of an uniform sequence of natural numbers. There are three RNG
> algorithms documented in the rand module:
>
> • Xoroshiro116+. According to the linked page at
> http://xoshiro.di.unimi.it/ , it is suitable only for floating point
> numbers, so it doesn’t fit. Moreover, the page actually describes an
> algorithm with 64-bit precision, while rand implements a variant with
> 56-bit precision. It looks like the latter is implemented only in Erlang,
> so there is little practical interoperability between languages.
> • Xorshift1024*. It fails the BigCrush test according to
> https://lemire.me/blog/2017/09/15/the-xorshift1024-random-
> number-generator-fails-bigcrush/ .
> • Xorshift116+. The comment about 58-bit precision being rare applies
> (according to https://github.com/jj1bdx/emprng/ , “the original exsplus
> was Xorshift128+”). Xorshift128+ fails the BigCrush test, so I presume that
> xorshift116+ fails it too.
>
> So… is there any particular reason for the rand module to not implement
> xoshiro256**, which is more widespread than 58-bit precision algorithms
> and, according to its creators, “has excellent (sub-ns) speed, a state
> space (256 bits) that is large enough for any parallel application, and it
> passes all tests we are aware of”?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180803/307d7070/attachment.htm>


More information about the erlang-questions mailing list