Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Johannes G.D. Hausmann <joe@neuro.uni-oldenburg.de>
Subject: Anyone using drand48()?
Date: Wed, 25 Feb 1998 10:51:46 +0000	[thread overview]
Message-ID: <c5850dcde4efaac4adb382900f6728ce.axp-list@archive.invalid> (raw)

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 <stdlib.h>

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

             reply	other threads:[~1998-02-25 10:51 UTC|newest]

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