Alex D Herbert created RNG-94:
---------------------------------

             Summary: Add RotateRotateMultiplyXorMultiplyXor generator
                 Key: RNG-94
                 URL: https://issues.apache.org/jira/browse/RNG-94
             Project: Commons RNG
          Issue Type: New Feature
          Components: core
    Affects Versions: 1.3
            Reporter: Alex D Herbert
            Assignee: Alex D Herbert


The generators described on the MostlyMangling website [Better, stronger mixer 
and a test 
procedure|http://mostlymangling.blogspot.com/2019/01/better-stronger-mixer-and-test-procedure.html]
 show better output than the Stafford variant 13 mixing function used in 
SplitMix or the murmur hash 3 mixing function used in ThreadLocalRandom for a 
64-bit based mixer function.
{code}
static inline uint64_t ror64(uint64_t v, int r) {
    return (v >> r) | (v << (64 - r));
}

// Old mixer, my rrmxmx
uint64_t rrmxmx(uint64_t v) {
  v ^= ror64(v, 49) ^ ror64(v, 24);
  v *= 0x9FB21C651E98DF25L;
  v ^= v >> 28;
  v *= 0x9FB21C651E98DF25L;
  return v ^ v >> 28;
}

// New mixer, "rrxmrrxmsx_0", this is much more well behaved although
// slightly slower doing 2 rotations instead of the shift in the middle 
// of rrmxmx.
// With a unit counter starting at 0, it has passed 128 TB of
// PractRand 0.94 -tf 2 without anomalies found past 2 TB.
uint64_t rrxmrrxmsx_0(uint64_t v) {
  v ^= ror64(v, 25) ^ ror64(v, 50);
  v *= 0xA24BAED4963EE407UL;
  v ^= ror64(v, 24) ^ ror64(v, 49);
  v *= 9FB21C651E98DF25UL;
  return v ^ v >> 28;
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to