[PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

Paolo Carlini paolo.carlini@oracle.com
Tue Dec 12 20:37:00 GMT 2017


Hi,

On 12/12/2017 19:42, Michele Pezzutti wrote:
> Hi.
>
> Yes, I looked at the text before submitting the patch.
>
> I contacted Devroye and he confirmed that another reader had also 
> pointed out this bug but not the solution. I sent him my proposed 
> patch, he will look into it (no idea when though).
Nice.
> I would state that "comparison function for x = 1 is e^(1/78)" (which 
> becomes 1/78 as the algorithm uses log-probabilities).
>
> I think the change is needed because otherwise, for that particular 
> bin, the rejection probability is lower than it should be, resulting 
> in a higher number of samples.
Ok. Ideally I would be much less nervous about committing the patch if 
we either 1- Had Luc's explicit green light; 2- Were able to *rigorously 
deduce* within the framework of the book why the change is needed. That 
said, the patch makes sense to me and so far holds up well in all my 
tests (I'm currently running a full make check). I would say, let's wait 
a week or so and then make the final decision. Jon, do you agree? Ideas 
about further testing? (eg, some code you are aware of stressing Poisson?)

Thanks again,
Paolo.



More information about the Libstdc++ mailing list