This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
rng/ranlxd.c
- From: Carsten Urbach <Carsten dot Urbach at physik dot fu-berlin dot de>
- To: gsl-discuss at sources dot redhat dot com
- Date: Fri, 13 Dec 2002 18:42:36 +0100
- Subject: rng/ranlxd.c
Hi,
I downloaded gsl version 1.2 because I was interested in the project and
especially in the double precision version of the ranlux random number
generator. I have one remark about your implementation, I do not know
whether this is important:
static inline unsigned long int
ranlxd_get (void *vstate)
{
return ranlxd_get_double (vstate) * 4294967296.0; /* 2^32 */
}
With 2^32 you will not get the whole range of the double precision
version. To get it you would have to multiply with 2^48. Of course this is
in general to big for a unsigned long int ... (but unsigned long long int
would do)
This is not a serious bug, but the quality of the generator decreases.
Or I am wrong ;-)
best
Carsten Urbach
--
Carsten Urbach
e-mail: curbach@gmx.de
Carsten.Urbach@physik.fu-berlin.de
Fon : +49 (0)30 79 70 95 78
+49 (0)30 838 53 742 (FU-Berlin)
+49 (0)33762 77313 (DESY/Zeuthen)
URL: www.physik.fu-berlin.de/~urbach