Boost logo

Boost :

From: Topher Cooper (topher_at_[hidden])
Date: 2007-12-26 09:50:56

Anyone attempting to generate non-uniform random numbers should
consult "Non-Uniform Random Variate Generation" by Luc Devroye, which
is available in full, for free use at:

Poisson generation is covered, specifically, in chapter 10:

starting on page 501.

How far off is the Poisson distribution from the normal at a mean of
750? How large a sample would you need to have, say, a one in a
thousand chance of detecting the difference? (I don't know the
answer, but if there is a problem at that extreme, its a question
that should be answered before getting too fancy with "precise" solutions).


At 07:08 AM 12/24/2007, you wrote:
> >-----Original Message-----
> >Sent: 22 December 2007 23:02
> >To: boost_at_[hidden]
> >Subject: [boost] [random] poisson_distribution problem and fix
> >
> >The poisson_distribution code will fail for any mean larger than 750
> >or so (on my x86_64 machine). The problem is a comparison with
> >exp(-_mean) which evaluates as zero right around there.
> >
> >A far better fix would be to use an algorithm other than Knuth's for
> >this. Knuth's algorithm is simple, but O(n). Here is some code I
> >wrote, converting some old Fortran code that a friend had got from
> >Numerical Recipes once upon a time. It works, but would need actual
> >testing before use in production code:
> >
> >#endif
>This looks too obviously lifted from NR in C (or FORTRAN) to fit the
>Boost license.

. . .

>Paul A Bristow
>Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
>+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS

Boost list run by bdawes at, gregod at, cpdaniel at, john at