2023-03-07 17:57:06 +00:00
|
|
|
package utils
|
|
|
|
|
2023-05-23 07:31:20 +00:00
|
|
|
// XorShift64Star Implementation of xorshift* https://en.wikipedia.org/wiki/Xorshift#xorshift*
|
|
|
|
// x must be initialized to a non-zero value
|
2023-03-07 17:57:06 +00:00
|
|
|
func XorShift64Star(x uint64) uint64 {
|
|
|
|
x ^= x >> 12
|
|
|
|
x ^= x << 25
|
|
|
|
x ^= x >> 27
|
|
|
|
return x * 0x2545F4914F6CDD1D
|
|
|
|
}
|