Javadoc
Static randomizing method that takes its state as a parameter and limits output to an int between 0 (inclusive)
and bound (exclusive); state is expected to change between calls to this. It is recommended that you use
DiverRNG.determineBounded(++state, bound) or
DiverRNG.determineBounded(--state, bound) to
produce a sequence of different numbers, but you can also use
DiverRNG.determineBounded(state += 12345L, bound) or any odd-number increment. All longs are accepted
by this method, but not all ints between 0 and bound are guaranteed to be produced with equal likelihood (for any
odd-number values for bound, this isn't possible for most generators). The bound can be negative.
This was the same as
LinnormRNG#determineBounded(long,int), but was changed to a slightly-faster method
that also has the advantage of being much harder to accidentally disrupt the input sequence. With LinnormRNG's
version, some odd-number increments will affect the sequence badly, such as 0xCB2C135370DC7C29, and using such an
increment there would ruin the quality of the determine() calls. That's because 0xCB2C135370DC7C29 is the
modular multiplicative inverse of 0x632BE59BD9B4E019, which LinnormRNG.determine() multiplies the input by as its
first step. Incrementing by 0xCB2C135370DC7C29 and then multiplying by 0x632BE59BD9B4E019 is the same as
incrementing by 1 every time, which LinnormRNG can handle only up to about 16GB in PractRand tests before failing
in a hurry. The algorithm used by DiverRNG is much more robust to unusual inputs (as long as they are odd), using
PCG-Random's style of random xorshift both to the left (to adjust the input) and to the right (after a large
multiplication, to bring more-random bits down to the less-significant end). Like LinnormRNG, this determine()
method is reversible, though it isn't easy to do. The algorithm used here is unrelated to DiverRNG, LinnormRNG,
and LinnormRNG.determine(), and passes PractRand to at least 2TB with no anomalies (extremely similar versions
have passed to 16TB and 32TB with no anomalies as well).