From 5f200821e1d4863a2b9b5f334e514ce8f6be9a5b Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Tue, 20 Feb 2024 12:05:16 -0500 Subject: [PATCH] jl_rng_split: permute state by multiply instead of add Issue raised here: https://discourse.julialang.org/t/linear-relationship-between-xoshiro-tasks/110454 --- src/task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/task.c b/src/task.c index a1e8dabb89f9dc..96fc22fb5e1b04 100644 --- a/src/task.c +++ b/src/task.c @@ -1079,7 +1079,7 @@ void jl_rng_split(uint64_t dst[JL_RNG_SIZE], uint64_t src[JL_RNG_SIZE]) JL_NOTSA p ^= p >> ((p >> 59) + 5); p *= m[i]; p ^= p >> 43; - dst[i] = src[i] + p; // SplitMix dot product + dst[i] = src[i] * (p | 1); // multiplicative permutation } }