From b776bf56b899625b37cc7ef66b96d1467786589f Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Thu, 23 Apr 2020 08:31:03 +0900 Subject: [PATCH] Improved lk scrambling function. This actually gets very close to the behavior of a full per-bit hash, except that you still need a fairly random seed. --- sub_crates/sobol/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/sub_crates/sobol/src/lib.rs b/sub_crates/sobol/src/lib.rs index efbea5a..9d01c51 100644 --- a/sub_crates/sobol/src/lib.rs +++ b/sub_crates/sobol/src/lib.rs @@ -80,6 +80,7 @@ fn lk_scramble(mut n: u32, scramble: u32) -> u32 { n = n.wrapping_add(scramble); for &p in PERMS.iter() { n ^= n.wrapping_mul(p); + n += n << 1; } n }