x ^= x >> 27; return x * 0x2545F4914F6CDD1DULL; } The generator fails only the MatrixRank test of BigCrush, however if the generator is modified to return only the high 32 bits, then it passes BigCrush with zero failures. In fact, a reduced version with only 40 bits of internal state passes the suite, suggesting a large safety margin. A similar generator suggested in Numerical Recipes as RanQ1 also fails the BirthdaySpacings test. Vigna suggests the following generator with 1024 bits of state and a maximal period of 21024−1; however, it does not always pass BigCrush. xoshiro256** is therefore a much better option. #include <stdint.h> /* The state must be seeded so that there is at least one non-zero element in array */ struct xorshift1024s_state { uint64_t x[16]; int index; }; uint64_t xorshift1024s(struct xorshift1024s_state *state) { int index = state->index; uint64_t const s = state->x[index++]; uint64_t t = state->x[index &= 15]; t ^= t << 31; // a t ^= t >> 11; // b -- Again, the shifts and the multipliers are tunable t ^= s ^ (s >> 30); // c state->x[index] = t; state->index = index; return t * 1181783497276652981ULL; } xorshift+ An generator can achieve an order of magnitude fewer failures than Mersenne Twister or WELL. A native C implementation of an xorshift+ generator that passes all tests from the BigCrush suite can typically generate a random number in fewer than 10 clock cycles on x86, thanks to instruction pipelining. Rather than using multiplication, it is possible to use addition as a faster non-linear transformation. The idea was first proposed by Saito and Matsumoto (also responsible for the Mersenne Twister) in the generator, which adds two consecutive outputs of an underlying generator based on 32-bit shifts. However, one disadvantage of adding consecutive outputs is that, while the underlying generator is 2-dimensionally equidistributed, the generator is only 1-dimensionally equidistributed. has some weakness in the low-order bits of its output; it fails several BigCrush tests when the output words are bit-reversed. To correct this problem, Vigna introduced the family, based on 64-bit shifts. generators, even as large as , exhibit some detectable linearity in the low-order bits of their output; it passes BigCrush, but doesn't when the 32 lowest-order bits are used in reverse order from each 64-bit word. This generator is one of the fastest generators passing BigCrush. The following generator uses 128 bits of state and