At Wed, 16 Aug 2006 17:08:12 +0200,
Dr. Hans Ekkehard Plesser wrote:
> This means that gsl_rng_uniform_pos cannot return 0, even though
>
> p(x) = 1/mu exp(-x/mu)
>
> has its maximum p(x=0) = 1/mu at x=0.
Thanks for the bug report. I think it might be a good idea to make
sure that 0 is sampled---the following might work:
double u = gsl_rng_uniform (r);
return -mu * (u == 0.0 ? 0.0 : log (u));
Maybe there are some more of these lurking in the other routines too?
--
Brian Gough
Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl