Short version: common MT (and MT64) implementations have a tempering parameter 'd' (a bit mask). The papers I've looked at describing MT don't include it. Where is it from? When was it added?

Long version! :)

I'm looking at using a family of MT's with different parameters (for reasons). Nishimura published this paper describing a 64-bit MT implementation and a number of alternatives for the A matrix and (u,s,t,l,b,c) tempering parameters. Like the original 32-bit MT paper, this describes the tempering procedure as:

y := x xor (x >> u)
y := y xor ((y << s) and b)
y := y xor ((y << t) and c)
z := y xor (y >> l)

However, real implementations *(3) *(4) and the parameters described in the MT Wikipedia page have an extra bit mask parameter (referred to as 'd'), applied to the first step of the tempering procedure:

x ^= (x >> 29) & 0x5555555555555555ULL;
x ^= (x << 17) & 0x71D67FFFEDA60000ULL;
x ^= (x << 37) & 0xFFF7EEE000000000ULL;
x ^= (x >> 43);

I don't want to just 'blindly' use the tempering parameters that exclude the parameter 'd' without understanding what it's for... but I can't seem to find any references for why this 'd' parameter was added. (Presumably, it's an improvement...)

Any ideas on what it's for, any references to why it was added?

  • $\begingroup$ I don't quite have enough reputation to include the links to 'real implementations' in the question. They are: *3 and *4 $\endgroup$ – Wuggy Dec 24 '16 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.