[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: new PRNG's**
**From**: Albert Chan <albertmcchan@...>
**Date**: Tue, 8 May 2018 08:22:58 -0400

> On May 8, 2018, at 5:06 AM, Sergey Rozhenko <sergroj@gmail.com> wrote:
> What about LuaJIT's PRNG? Having the same PRNG would be good for compatibility.
Compatibility with LuaJIT ?
Should it be the other way around ?
> "LuaJIT uses a Tausworthe PRNG with period 2^223 to implement math.random() and math.randomseed()."
Tausworthe PRNG is old (1991), and will fail linearity test.
(It look like xorshift+ without the plus "scrambler")
LuaJIT's implementation also have problem with range bias.
(It just use 52 bit random float to calculate math.random(n,m))
https://github.com/aerospike/luajit/blob/master/src/lib_math.c