From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <34F3F7C2.F09@neuro.uni-oldenburg.de> Date: Tue, 13 Nov 1945 23:36:54 -0500 (EST) From: Jonathan L Dubois Subject: Re: Anyone using drand48()? In-Reply-To: <34F3F7C2.F09@neuro.uni-oldenburg.de> On Wed, 25 Feb 1998, Johannes G.D. Hausmann wrote: > No joke, am I doing something obviously wrong? The output of the program > tells me that drand48 gives very correlated (!) random numbers, namely > all lying on (n-1)-dimensional hyperplanes, straight lines in this case. > > I've counterchecked on Intel/Linux and Sun/Solaris machines - they give > identical output, which is good (provided seeds are the same). I've also > tried using lcong48() in order to set multiplier and addend of the LCG > myself - no go. Linux/Alpha drand48 continually spews out correlated > sequences differing from Sun and Intel, although the seeds are the same. > > BTW, hardware is PC164 running DLD5.3 Classic for Alpha (a german > distribution, it still uses glibc-1.99, kernel is 2.0.33). > > Anyone willing to reproduce this? Also, who would know what to do about > it? the problem may be a missing #include and printf("%.8f %.8f\n",x,y); should be printf("%.8lf %.8lf\n",x,y); I compared the output from my alpha (164LX) and and SGI origin and got the same results on both -- I didnt run the correlation check however. If the above doesnt solve your problem you may want to consider one of the rand routines in numerical recipes http://cfatab.harvard.edu/nr/nronline.html or try Donald Knuths algorithm at http://www-cs-staff.stanford.edu/~knuth/programs/rng-double.c Hope this helps, Jonathan DuBois -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com