ON HOLD PENDING REVIEW... SEE TO DO LIST
I have modified Xoroshiro32++ to improve escape from zero behavior and general statistical properties:
Xoroshiro32ppg
The modification required only three minor changes:
1. Added a Boolean negation character '~' to one of the s1 occurrences.
2. Reversed the direction of the shift from '<<' to '>>'.
3. Adapted the constants to the above changes, most notably setting B = 1 to form an Inverted Gray Code with changes #1 and #2.
TO DO LIST:
1. Calculate invalid seed for each candidate set of triplets, as 0,0 no longer applies when negation/not is used. TEDIOUS... HOWEVER, BRUTE-FORCE AT 32-BIT TAKES ONLY A FEW SECONDS PER CANDIDATE SET.
2. Calculate output correction for each candidate set, as the normal output short by a single missing zero is now missing a single non-zero value. DONE: PASS INVALID SEED HALVES TO OUTPUT SCRAMBLER.
3. Re-evaluate the reversal of the shift and the recommendation of B = 1, when in fact other choices may be superior. LIKELY SHIFT IN EITHER DIRECTION CAN WORK WELL - BUT MUST ANALYZE REVERSE BITS ALSO.
Escape-from-zero behavior with only 1 state bit set (in average bits set per for 10 consecutive 16-bit outputs):
Xoroshiro32pp 1.5 5.375 6.96875 7.96875 8.75 8.1875 7.46875 8.6875 8.375 8.5
Xoroshiro32ppg 1.5 10.375 6.5 7.34375 8.59375 8.03125 7.875 8.25 8.0625 7.59375
Here are the standard (+) and Gray modified (+g) escape-from-zero values for comparison: