[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

your implementation of L'Ecuyer's MRG32k3a generator




Brad,

At the moment I am redesigning the SRFI-27 on random sources.

I have adopted your proposal of using the MRG32k3a method of P. L'Ecuyer
as the default implementation and have implemented it just using (allocated)
integers. Now I am putting together a fixnum/flonum implementation, too,
as the generic implementation could be terribly slow.

I have the following question regarding your code (which seems to me
quite efficient):

* Why do you use an f64vector for the seed? Is this more efficient than
creating six different variables? (for example because flonums are
allocated rather than immediate)

* Why does the fixnum/flonum implementation need flonums at all?
Wouldn't it be more efficient to use 54-bit fixnums throughout? (Which
should be there in a Scheme running on a DEC Alpha)

* What does (declare (flonum)) actually mean here?

* Why have you chosen to write a nested let _expression_ instead of a let*?
Is this a special style recognized by the compiler to get better code?

* I have installed GAMBIT here at a HP system. The definition
flonum-m-bits-plus-1 in the 'header.scm' file shows that the actual
mantissa width of FLONUMs are just 53 bits; which is exactly one bit short
of what is needed for MRG32k3a theoretically. Do you have the same
problem on your platform? If not, what platform (HW/SW) are you using?

Sebastian.

----
Dr. Sebastian Egner
Senior Scientist
Philips Research Laboratories
Prof. Holstlaan 4 (WY2)
5656 AA Eindhoven
The Netherlands
tel:       +31 40 27-43309
fax:      +31 40 27-44918
email: sebastian.egner@xxxxxxxxxxx