33 ms·
Personally I'm a fan of the xoshiro[1] generator I have found it to be faster and give more equiprobable outputs. [1]http://xoshiro.di.unimi.it http://xoshiro.
by sdmike1 8y ago
Personally I'm a fan of the xoshiro[1] generator I have found it to be faster and give more equiprobable outputs.
[1]http://xoshiro.di.unimi.it http://xoshiro.di.unimi.it
- dahart 8y agoThe article discusses the xoshiro RNG, and some better alternatives: “One other concern we might have is that some generators have weak low-order bits. For example, the Xoroshiro+ and Xoshiro+ families of PRNGs have low-order bits that fail statistical tests.“ The xoshiro page mentions this too, and says it won’t matter if you are generating random floats, but the article is generating random ints. The RNG isn’t the point of the article though. It’s discussing the speed and correctness of what happens after the RNG but before you use the results.
- throwaway080383 8y agoNote that this article is not about the random number generating scheme, but about post-processing to get a random number within a certain range. That said, the author specifically points out xoshiro as a random number generating scheme to watch out for: One other concern we might have is that some generators have weak low-order bits. For example, the Xoroshiro+ and Xoshiro+ families of PRNGs have low-order bits that fail statistical tests. When we perform % 52 (because 52 is even) we pass the lowest bit straight through into the output.
- smaddox 8y agoxoshiro has flaws: http://www.pcg-random.org/posts/a-quick-look-at-xoshiro256.html http://www.pcg-random.org/posts/a-quick-look-at-xoshiro256.h...
- nightcracker 8y agoxoshiro's response: http://pcg.di.unimi.it/pcg.php http://pcg.di.unimi.it/pcg.php
- smaddox 8y agoInteresting read, thanks! The deflection about xoshiro is not particularly convincing, though. It's much more likely that you'll want to multiply your random stream by a multiple of 57 than you'll want to xor it with a 43-bit-shifted version of itself. He also doesn't appear to counter the complaint about the generator getting stuck around 0: http://www.pcg-random.org/posts/xoshiro-repeat-flaws.html http://www.pcg-random.org/posts/xoshiro-repeat-flaws.html The other parts of the post definitely concern me about using the PCG's described, though. Also, it's interesting to see how PCG can be predicted. I would not have known how to attack it.
- zeeboo 8y agoHis "attack" is literally a brute force of 32 bits of state. It would not scale to PCG with 128 bits of internal state.
- modeless 8y agoMelissa O'Neill's response back: http://www.pcg-random.org/posts/on-vignas-pcg-critique.html http://www.pcg-random.org/posts/on-vignas-pcg-critique.html
- smaddox 8y agoThanks. This completely allays my concerns about the PCG's I would actually use. Edit: And I like that MCG with 64-bit multiplicand that she shows. I might switch to that for Monte Carlo applications.