RANDOM() and RANDOM(FALSE) problem



--- Raymond Toy  wrote:

>     Robert> The down side is that it's substantially slower than the
>     Robert> unmodified mt19937. 
> 
> I'm a bit surprised.  How did you compare the generation speed
> between your version and the unmodified mt19937?  

Well, I did this:

  (load "rand-mt19937.lisp")
  (time (dotimes (i 1000000) (mt19937::random 123456)))

and compared that to: (time (dotimes (i 1000000) (random 123456)))

But perhaps I should have done this:

  (compile-file "rand-mt19937.lisp")
  (load "rand-mt19937.x86f")
  (time (dotimes (i 1000000) (mt19937::random 123456)))

That is MUCH faster. 

The built-in CMUCL RANDOM runs about 0.1 microseconds per
random number this way. MT19937::RANDOM runs about 0.3 microseconds.

Of course speed will vary by Lisp implementation and 
hardware platform. 

Incidentally, Clisp barfs on (compile-file "rand-mt19937.lisp") --
it complains "cannot redefine built-in class #", although (load "rand-mt19937.lisp") is OK.
Any idea about how to make Clisp compile happily? 

For what it's worth,
Robert Dodier




	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail