[computer-go] Fast random int generation

alain Baeckeroot alain.baeckeroot at laposte.net
Fri Sep 1 00:53:21 PDT 2006


Le jeudi 31 août 2006 16:23, Don Dailey a écrit :
> I will plug this in and give it a try.
> 
> One of my toy Go program used a simple generator similar to this and it
> worked well - but I could play a few thousand games and observe that it
> was repeating games very frequently.   It doesn't do that with a better
> generator.   
> 
> So this will be a test I apply to this generator.  I also always
> self-test versions against the previous - to verify that I didn't screw
> something up.   I think I read about this generator somewhere - designed
> to try to be the fasted 'acceptable' generator possible.
> 
> - Don
> 
>  
> 
> On Thu, 2006-08-31 at 14:56 +0200, Łukasz Lew wrote:
> > Someone (Don?) asked for a fast random generator.
> > Here it is.
> > 
> > Standard library rand() in linux takes about 200 clock cycles.
> > pm::rand() takes 30cc on my hardware.
> >

http://www.agner.org/random/randoma.htm
unless i misread, there is a MC quality random generator 
(mersenne twister) in 44 cycle (coded in asm), and the source
are available under GPL :)

Alain


More information about the computer-go mailing list