Follow-up Comment #2, bug #24252 (group gsl):

I found this patch to be between 1 to 2 orders of magnitude faster than the
existing implementation.

Then the function gsl_ran_gamma in file randist/gamma.c can benefit straight
away, because this code block:

  /* assume a > 0 */
  if (a < 1)
    {
      double u = gsl_rng_uniform_pos (r);
      return gsl_ran_gamma (r, 1.0 + a, b) * pow (u, 1.0 / a);
    }

can be rewritten as this:

  /* assume a > 0 */
  if (a < 1)
    return gsl_ran_gamma_tail (r, 0.0, a, b);



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?24252>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to