lemire / testingRNG

Testing common random-number generators (RNG)
Apache License 2.0
172 stars 22 forks source link

This looks like it's an incorrect usage of splitmix64 #24

Closed rdebath closed 1 year ago

rdebath commented 1 year ago

This looks like it's an incorrect usage of splitmix64_stateless

https://github.com/lemire/testingRNG/blob/bfd776ba13b837bc1680de08e5de389a7f44f10d/source/lehmer64.h#L22

I would expect to be using the small seed as the seed to a splitmix64 generator and use two sequential values returned by that generator as the 128bit seed for the target generator (perhaps after skipping some values for mixing).

But this +1 doesn't get the next value instead it gets the first result of the next higher seed, effectively using a constant for the generator of 1 rather than 0x9e3779b97f4a7c15. This is a very poor value to use as a substitute for "Weyl sequence" that looks to be related to the issue that Dr. O'Neill describes in her "bugs in splitmix" post.

lemire commented 1 year ago

Pull request invited

lemire commented 1 year ago

Closing via pull request.