4 ms·
A 15 character 64 to 32-bit generator I devised which passes dieharder: (x+=x*x+9)>>32;
by eutectic 10y ago
A 15 character 64 to 32-bit generator I devised which passes dieharder:
(x+=x*x+9)>>32;
- joegosse 10y agoIs dieharder considered as the industry standard tool for testing randomness? Is it commonly used by experts? https://www.phy.duke.edu/~rgb/General/dieharder.php https://www.phy.duke.edu/~rgb/General/dieharder.php
- eutectic 10y agoDieharder works OK, and you can easily install it on Ubuntu as a command-line tool. PractRand and TestU01 are more stringent and give you more knobs to play with.
- Someone 10y agoThat can be made shorter: x+=x*x+9; Are you sure you don't mean x+=((x*x+9)>>32); (and does that need the outer parentheses?) I doubt the first passes dieharder, as (if my C isn't too rusty) it alternates between odd and even numbers.
- eutectic 10y agoI mean you assign the value of the expression to your result. e.g: uint64_t x = 0; ... uint32_t y = (x+=x*x+9)>>32;