From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <34F3F7C2.F09@neuro.uni-oldenburg.de> Date: Wed, 25 Feb 1998 10:51:46 +0000 From: Johannes G.D. Hausmann Subject: Anyone using drand48()? This is a multi-part message in MIME format. --------------33F1117619EE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all! Have you ever bought a car and found out, after driving a few miles, that you're missing the wheels? This is how I felt last night after testing drand48() using the attached program. 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? cu, Jo -- ----------------------------------------- Johannes Hausmann Carl von Ossietzky Universitaet Oldenburg FB Physik -- AG Komplexe Systeme EMail : joe@neuro.uni-oldenburg.de ----------------------------------------- --------------33F1117619EE Content-Type: text/plain; charset=us-ascii; name="myRnd.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="myRnd.c" #include int main(void) { long int i; double x,y; srand48(36583); y = drand48(); for(i=0;i<10000;i++) { x = y; y = drand48(); printf("%.8f %.8f\n",x,y); } return(0); } --------------33F1117619EE-- -- 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