TGIF folks, FYI - I discovered by accident yesterday in this article
<https://blogs.siliconorchid.com/post/coding-inspiration/randomness-in-dotnet/>
that the algorithm used by the Random class has changed. Historically it
has used the Knuth subtractive algorithm
<https://www.informit.com/articles/article.aspx?p=2221790>, which is old
and respected, and reasonably simple. It holds its internal state in a
seeded int[56] array (I don't know how it scores on cruel tests like
BigCrush <https://en.wikipedia.org/wiki/TestU01>).

It's been replaced with one of the set of new *xoroshiro* algorithms, which
I didn't know about until yesterday. The code is so short that you can't
believe they actually work and produce results that pass tests that even
some of the famous ones like Mersenne Twister can fail. I'm just amazed by
the brevity and quality <https://prng.di.unimi.it/> (C code links
top-right).

ILSpy shows how Random has been completely rejigged to use the new
algorithm or fallback to the internal Net5CompatDerivedImpl class.

*Greg K*

Reply via email to