https://issues.apache.org/ooo/show_bug.cgi?id=121421
--- Comment #4 from orcmid <[email protected]> --- (In reply to comment #2) > (In reply to comment #1) [ ... ] > > First, salting must ensure that the initial IX, IY, and IZ values are > > positive nonzero values less than the corresponding modulus values (30269, > > 30307, and 30323). > The FORTRAN comment states clearly that IX, IY and IZ must be values between > 1 and 30000. I don't think it matters but it would be interesting to know what Wichman-Hill said about it. The use of Wichmann-Hill in the system, R, seeds with random values in the constraints I state. It seems strange to restrict the salt values to ones less than those that can be produced and consumed by the respective functions. > > > I'm also marginally suspicious of all of those floating-point divisions, > > since the moduli are all relatively prime to 2 (and 5). The arithmetic in > > the RANDOM line should all be in DOUBLE (if not greater) and it is not clear > > how many bits of the AMOD result should be considered reliable, since > > recurrence patterns will happen. > > > > I would think the divisions are made precisely to make the remainders more > random. One thing that where we will necessarily lose is speed though: on > FreeBSD random(3) is 2/3 the speed of rand(3). This algorithm will be at > least three times slower. The divisions just change the values from the integer modular generators into fractions, x, in the range 0 < x < 1. It doesn't do anything to increase randomness. The original values can be reconstructed pretty easily, especially with such small modulus values. Adding them together and discarding the integer part is what makes this generator interesting. There's also a serious error in the Microsoft description. It is true that if those fractions were random on [0,1] the fractional part of their sum is also random. But the IX, IY, and IZ sequences are hardly random at all. So the claim is insufficient as a rationale for the heightened randomness of the combination. The only remark that Donald Knuth makes on the Wichmann-Hill generator is that they provide a reliable method for computing the mod function of a double-word value and a single-word modulus. This arises in the solution to Exercise 3.2.1.1(9) in The Art of Computer Programming. I nosed around a bit more. There are special requirements on the initial seed to ensure that a maximum period is obtained. There are other conditions that I was unable to dig into quickly. [I collided with your proof of concept. I'll look at it now.] -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.
