Skip to content

Commit

Permalink
hp16: Slightly better 3-round xorshift-multiply
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Apr 2, 2021
1 parent 4c30dc6 commit ea7ee99
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,16 @@ uint16_t hash16_xm2(uint16_t x)
}

// 3-round xorshift-multiply (-Xn3)
// bias = 0.0046053682203863666
// bias = 0.0045976709018820602
uint16_t hash16_xm3(uint16_t x)
{
x ^= x >> 7; x *= 0x44f7U;
x ^= x >> 5; x *= 0xd051U;
x ^= x >> 8; x *= 0x6b69U;
x ^= x >> 8;
x ^= x >> 7; x *= 0x2993U;
x ^= x >> 5; x *= 0xe877U;
x ^= x >> 9; x *= 0x0235U;
x ^= x >> 10;
return x;
}


// No multiplication (-Imn6)
// bias = 0.023840118344741465
uint16_t hash16_s6(uint16_t x)
Expand Down

0 comments on commit ea7ee99

Please sign in to comment.