https://issues.apache.org/ooo/show_bug.cgi?id=121421

--- Comment #20 from orcmid <[email protected]> ---
(In reply to comment #18)
> That's a nice find.  The recommended boost::mt19937 is the Mersenne Twister.
> It has an insane period accomplished with a 2500 byte "state".  Even so, it
> runs about 4 times as fast as the improved Wichmann-Hill algorithm in their
> 2005 paper's estimation.  The improved Wichmann-Hill may rank better on x64
> though.

I knew my ACM Digital Library subscription was good for something.

The Mersenne Twister paper is the most-heavily cited paper of any in ACM TOMAS
(Transactions on Modeling and Simulation).  It is also the most downloaded
paper.

In addition to extensive analysis and provision of an abstract algorithm, there
is a C Language implementation of mt19937 in the paper.  This is apparently
code-identical to the method used in boost::mt19937.  According to the boost
documentation, there was a tweak concerning the seed process when given an
integer value as starter for the internal seed generation.  That is probably
unimportant for now.  I don't know if that was an implementation issue or a
problem in the original paper.

I do notice in the C code that everything in MT Twister is done with 32-bit
unsigned integers, although it returns a [0..1] float.  It looks like 1 is a
possible result.

I can't post the paper, but I can extract the C code, for comparison with the
32-bit Wichmann-Hill.

PS: Wichmann-Hill can return 0, but it can't return 1.  I forgot that x -
int(x) can catch a 0 (including by underflow) when the sum of fractions is near
enough to 1, 2, or 3.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to