At Thu, 15 Jul 2010 15:17:00 -0700, Michael Radford wrote: > For example: > (gdb) call gsl_ran_beta_pdf(1,100,100) > $26 = 0 > (gdb) call gsl_ran_beta_pdf(0,100,100) > $27 = 0 > (gdb) call gsl_ran_beta_pdf(1,1000,1000) > $28 = -nan(0x8000000000000) > (gdb) call gsl_ran_beta_pdf(0,1000,1000) > $29 = -nan(0x8000000000000) > > but the correct result is always 0 when x == 0 or 1 and a, b > 1. > > The reason is that the call to exp() overflows when a and b are > large enough. However, it's unnecessary to call exp() when either > of the two calls to pow() will return 0. > > I'm attaching a minimal patch which simply checks for a, b > 1 > and explicitly returns 0 in that case. >
Thanks for the bug report and patch! I've applied it. Sorry for the delay in replying. -- Brian Gough _______________________________________________ Bug-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-gsl
