Skip to content

Instantly share code, notes, and snippets.

@Jamil
Created December 23, 2016 22:16
Show Gist options
  • Select an option

  • Save Jamil/874fb73ae3448db26d9ca0424fa698ee to your computer and use it in GitHub Desktop.

Select an option

Save Jamil/874fb73ae3448db26d9ca0424fa698ee to your computer and use it in GitHub Desktop.
XOR Shift pseudorandom number generator
pseudorand seed = (c * 2685821657736338717) .&. (2 ^ 64 - 1)
where a = seed `xor` (seed `shiftR` 12)
b = a `xor` (a `shiftL` 25)
c = b `xor` (b `shiftR` 27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment