[PATCH] libstdc++: add uniform on sphere distribution
Sat Aug 9 11:55:00 GMT 2014
On Sat, Aug 9, 2014 at 3:15 AM, Marc Glisse <firstname.lastname@example.org> wrote:
> While there, do we want to also reject infinite norms?
> I would have done: while (__sum < small || __sum > large)
> but testing exactly for 0 and infinity seems good enough.
I guess the squaring can theoretically overflow and produce infinity.
It will never happen with the way we generate normally distributed
numbers, though. These values are always so unlikely that it is OK
that the algorithms cannot return them. If you insist I'll add a test
The other change (which would eliminate the necessity for this test in
a special case) is to use hypot for _Dimen==2. This might be a case
common enough to warrant that little bit of extra text. I'll prepare
More information about the Libstdc++