URL:
  <http://savannah.gnu.org/bugs/?31854>

                 Summary: A divide by zero in the gsl_ran_gamma_knuth()
                 Project: GNU Scientific Library
            Submitted by: relent95
            Submitted on: Sun Dec 12 16:47:09 2010
                Category: Runtime error
                Severity: 3 - Normal
        Operating System: 
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 1.14
         Discussion Lock: Any

    _______________________________________________________

Details:

The following lines of the randist/gamma.c calls gamma_frac(r, 0) if a is an
integer.

double
gsl_ran_gamma_knuth (const gsl_rng * r, const double a, const double b)
...
  if(a >= UINT_MAX) 
    {
      return b * (gamma_large (r, floor (a)) + gamma_frac (r, a - floor
(a)));
    }
...


And as the following, the argument a of the gamma_frac() shouldn't be zero.

static double
gamma_frac (const gsl_rng * r, const double a)
{
...
          x = exp ((1 / a) * log (v));
...
}







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31854>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to