4 ms·
Nice work, I've always wondered if we can brute-force search for good mixers like this! Take a look at the PCG paper for a strong family of mixers, including m
by Straw 5y ago
Nice work, I've always wondered if we can brute-force search for good mixers like this!
Take a look at the PCG paper for a strong family of mixers, including most of what you've tried:
https://www.pcg-random.org/paper.html https://www.pcg-random.org/paper.html
Multiplication is very good for mixing low to high, and xorshift moves the bits back to low. PCG also has tricks like "random" xor-shift, where the shift is determined by the top bits.
Additionally, you might want to try varying the word size as in PCG- as you get into strong mixers, they'll all pass PractRand (or take excessively long to fail), so to make things harder you can force them to have less state to work with.
Oh, to convert these invertible mixers into RNGs, you might not want to output the entire result, or you'll fail a birthday test after 2^32 outputs or so. You could do something like squish two halves of the output together, or perhaps even xor the counter into the output like in ChaCha.