3 ms·
When you say Mersenne-Twister isn't good enough, what are the other shortcomings apart from speed? It seems that even modern versions of Python are continuing t
by aryamansharda 6y ago
When you say Mersenne-Twister isn't good enough, what are the other shortcomings apart from speed? It seems that even modern versions of Python are continuing to use it...
- Straw 6y agoIts slow, large, and statistically worse than modern PRNGs- and jumping ahead takes longer and a more complicated algorithm. Even a truncated 128-bit LCG has far better properties. See https://www.pcg-random.org/index.html https://www.pcg-random.org/index.html The homepage might come across as a a little overzealous (for example ChaCha quality listed as good rather than excellent), but generally has good points.
- benibela 6y agoHowever, this page claims PCG is rather bad: http://pcg.di.unimi.it/pcg.php http://pcg.di.unimi.it/pcg.php They recommend to use their xoshiro PRNG.
- Straw 6y agoThat author has a history of extreme bias and almost-vindictive personal attacks on the author of PCG. See the reddit comments: https://www.reddit.com/r/programming/comments/8jbkgy/the_wrapup_on_pcg_generators/ https://www.reddit.com/r/programming/comments/8jbkgy/the_wra... And the PCG author's response: https://www.pcg-random.org/posts/on-vignas-pcg-critique.html https://www.pcg-random.org/posts/on-vignas-pcg-critique.html For example, for one of his arguments, he specifically chose a generator called pcg32_once_insecure, which the PCG author does not recommend due to its invertible output function! Personally, I have read both arguments in detail and I would always use PCG or even a truncated LCG over xoshiro, which has a large size in comparison, potentially worse statistical properties, and no gain- faster in some benchmarks and slower in others.
- benibela 6y agoWell, I had only skimmed the page But I am using xoshiro in my projects, because I thought xor was simpler than multiplication.
- Straw 6y agoYeah, xor is simpler than multiplication in terms of hardware complexity- luckily, we have the multiplication circuits built in, so may as well take advantage of them.
- rurban 6y agoXoshiro ist only fast, nothing else. PCG has much better properties. Fast is not everything. But there exist some new and very fast PRNG's which are fast and extremely good. Almost TRNG, wyrand eg.