This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48114] [C++0x] binomial_distribution incorrect for p > .5 and geometric_distribution wrongly implements the TR1 definition
- From: "aaz at althenia dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2011 18:07:23 +0000
- Subject: [Bug libstdc++/48114] [C++0x] binomial_distribution incorrect for p > .5 and geometric_distribution wrongly implements the TR1 definition
- Auto-submitted: auto-generated
- References: <bug-48114-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48114
--- Comment #12 from Andrey Zholos <aaz at althenia dot net> 2011-03-14 18:07:22 UTC ---
The double __p also fixes an infinite (maybe) loop in both
binomial_distribution(100, .75) and binomial_distribution(100, .25)
when _GLIBCXX_USE_C99_MATH_TR1 is defined.
I guess the proper way to test the algorithms is to generate a lot of
values and do a Pearson's chi-square test to check that the distribution
is correct. Then that can be used to make a faster testcase for just a
few values.