Created
November 28, 2016 16:16
-
-
Save TACIXAT/9ddf82c879c5f760a5bd83922d1a088d to your computer and use it in GitHub Desktop.
Python XorShift128Plus Algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def xs128p(state0, state1): | |
s1 = state0 | |
s0 = state1 | |
s1 ^= (s1 << 23) | |
s1 ^= (s1 >> 17) | |
s1 ^= s0 | |
s1 ^= (s0 >> 26) | |
state0 = state1 | |
state1 = s1 | |
generated = (state0 + state1) | |
return state0, state1, generated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment