At least one, possibly two other bugs lurking in the implementation.<p>1) Algorithm FT says:<p><pre><code> 1. Generate u. Store the first bit of u
as a sign s (s=0 if u<1/2, s=1 if u>=1/2).
</code></pre>
and yet the C code implements<p><pre><code> if ( u <= 0.5 ) s = 0.0;
else s = 1.0;
</code></pre>
2) I can't be sure of the following w/o access to doc. But i4_uni() says<p><pre><code> a uniform distribution over (1, 2147483562)
</code></pre>
which, offhand, is suspicious. A distribution over positive integers would probably want to use <i>all</i> available values in a 32-bit signed int, so it would most likely end at 2^31 -1 which is 2147483647, and not the value given.