*********************
MARCEL!
I don't believe you have made any mistake with the random generator, so long as there is no chance of 64 bit excess (non-zero bits) shifting into the 32 bit values. This would only bother the right shift, but looks ok.
********************
***********************
It looks like you and your computer have been very busy. Step back for a second.
The random generator is working corectly. It's just not the same kind of generator you are used to. The old LCGs (linear congruential generators) input a seed (a seperate operation), cycled the seed, and spit back the new seed as the random result. The output was always of the same period as the generator, one big cycle.
The rnd generator builds on that idea by incorporating another step, the take-off function. Instead of just showing you the seed every time you ask, the rnd generator gives you a scrambled version of it. In this case the take-off is:
dup 13 lshift xor dup 17 rshift xor
.
The fact that the same function has dual-use just makes rnd faster and shorter.
Imagine I have a random list of ten numbers 1 to10. If you ask me for a new number, I'll just move to the next on the list and give that to you. If I run out of numbers, I go back to the beginning and give you the first number.
Now with a take-off function, my friend also has a list. When you ask for my number, I give it to my friend. He looks at my number and gives you the number that corresponds to my number from his list, which usually differs from mine. This makes it harder for you to measure the period of my generator.
That is where the problem lies. The latest xtest starts my list from a given seed, and counts how many steps until my friend's number matches the given. That shows only how far out of sync the two lists are for that number. If you want to know how long the list is, one way is to ask for rnd then count how many steps until you get the same result.
****************
In light of the above, this just says the two lists are in sync for this number.
I hope I have explained this clearly. I'll keep an eye out for your questions and comments here.
Sincerely,
James Gere
********************************************************************