On 1/21/11 4:53 PM, Matthew Gwynne wrote:
> Thanks all!
>
> On Thu, Jan 20, 2011 at 9:35 PM, Robert Dodier <robert.dodier at gmail.com> wrote:
>> IIRC Maxima's MT implement generates chunks of 32 bits at a time,
>> and uses those to construct the output which is some number
>> of bits wide. For each N-bit output, Maxima uses 1 + floor(N/32) chunks.
>> Any leftover bits are thrown away (not used for the next output).
> Ah yes, I've found this now. Is this described in the mt19937
> standard? Or is this simply one way out of many to do this?
No, I don't think there's a description of how to do this in the mt19937
docs. There is an example, I think, of how to create a 64-bit
floating-point number from the 32-bit values, though. And cmucl
actually only takes part of each 32-bit integer and concatenates them to
create the larger integer. This, I think, is for historical reasons
where the old generator produced 32-bit chunks where the least (or
most?) significant bits were not as random as the rest.
Ray