This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rng/ranlxd.c


Carsten Urbach writes:
 > 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.

The gsl_rng_uniform (ranlxd_get_double) method returns all 48 random
bits in the range [0,1). See the docs for that function in the manual.

Brian





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]