Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Jonathan L Dubois <dubois@bec.physics.udel.edu>
Subject: Re: Anyone using drand48()?
Date: Tue, 13 Nov 1945 23:36:54 -0500 (EST)	[thread overview]
Message-ID: <ad56f6ec4673269677cdda74cb917499.axp-list@archive.invalid> (raw)
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 <stdio.h>

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

       reply	other threads:[~1998-02-25  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <34F3F7C2.F09@neuro.uni-oldenburg.de>
1998-02-25  7:12 ` Jonathan L Dubois [this message]
1998-02-25 10:51 Anyone using drand48()? Johannes G.D. Hausmann
  -- strict thread matches above, loose matches on Subject: below --
1998-02-25 11:21 Uncle George
     [not found] <Pine.LNX.3.96.451113233133.949C-100000@bec.physics.udel.edu>
1998-02-25 15:04 ` Michal Jaegermann
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox