Rex Kerr
Apr 24, 2024

--

I don't really understand why this would be a substantial improvement over the Pcg family of random number generators. Yes, it avoids multiplications, but how often do you need an ultra-fast random number generator on hardware without a fast multiply? FPGAs or something?

For 32 bits, you have four shifts, three bitwise operations, two adds, and three stores (all 32 bit).

Is it substantially faster than the Pcg family for a given period length? The standard Pcg32 has five shifts, three bitwise operations, one add, one multiply, and one store (multiply, add, and store are all 64 bit; the others are 32 bit).

By eye, on a modern heavily pipelined CPU architecture, I wouldn't bet one one over the other in terms of speed.

--

--

Rex Kerr
Rex Kerr

Written by Rex Kerr

One who rejoices when everything is made as simple as possible, but no simpler. Sayer of things that may be wrong, but not so bad that they're not even wrong.

No responses yet