[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (work1) now available
- From: albertmcchan <albertmcchan@...>
- Date: Thu, 15 Mar 2018 22:06:12 -0400
On Mar 15, 2018, at 7:50 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>> is math.random uses xorshift128+ algorithm ?
>>
>> why is the code different from https://en.m.wikipedia.org/wiki/Xorshift ?
>
> See these:
> http://xoroshiro.di.unimi.it
> http://xoroshiro.di.unimi.it/xorshift128plus.c
> https://stackoverflow.com/questions/34426499/what-is-the-real-definition-of-the-xorshift128-algorithm
>
thanks.
from the c source code comments, it seems the low bits is not
as good as the high bits. You might consider using the top bits to
build the double value (math.random() is using low bits via maskFIG)
this is a quote from above xorshift128plus.c:
We suggest to use a sign test to extract a random boolean value,
and right shifts to extract subsets of bits.
- References:
- [ANN] Lua 5.4.0 (work1) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.4.0 (work1) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.4.0 (work1) now available, Xavier Wang
- Re: [ANN] Lua 5.4.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.4.0 (work1) now available, pocomane
- Re: [ANN] Lua 5.4.0 (work1) now available, Dirk Laurie
- Re: [ANN] Lua 5.4.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.4.0 (work1) now available, Dirk Laurie
- Re: [ANN] Lua 5.4.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.4.0 (work1) now available, pocomane
- Re: [ANN] Lua 5.4.0 (work1) now available, Tim Hill
- Re: [ANN] Lua 5.4.0 (work1) now available, albertmcchan
- Re: [ANN] Lua 5.4.0 (work1) now available, Luiz Henrique de Figueiredo