bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl_ran_gaussian_ziggurat


From: allege54
Subject: [Bug-gsl] gsl_ran_gaussian_ziggurat
Date: Sat, 3 Mar 2012 09:55:28 +0100 (CET)

Hello, 

Using gsl_ran_gaussian_ziggurat, I sometimes got 0.00000 which is normally that
something is not really expected (well, rigorously speaking, it may happens).

However, having a look at the code and performed some checks, it appears to me 
that 
in the first lines

  while (1)
    {
      if (range >= 0xFFFFFFFF)
        {
          unsigned long int k = gsl_rng_get(r) - offset;
          i = (k & 0xFF);
          j = (k >> 8) & 0xFFFFFF;
        }
      else  [...]

we get a value of j=0 when k<256. With mt19937, this may happens with 
probability 6e-8
against 1e-8 for any other value. Hence, this is then not negligeable. 

I do not know what I should do with this. 

Thank you 
Yours sincerely
Antoine Lejay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]