Boost C++ Libraries: Ticket #6151: Wrong output from boot::math, cdf(complement(laplace_distribuiton<>(...)) https://svn.boost.org/trac10/ticket/6151 <p> To illustrate the bug, see the following code, </p> <pre class="wiki"> #include &lt;boost/math/distributions/laplace.hpp&gt; #include &lt;iostream&gt; int main () { boost::math::laplace lap(1, 1); std::cout &lt;&lt; boost::math::cdf(lap, 1) &lt;&lt; std::endl; std::cout &lt;&lt; boost::math::cdf(boost::math::complement(lap, 1)) &lt;&lt; std::endl; return 0; } </pre><p> The output should be two numbers sum up to 1. Instead, it print </p> <p> 0.5 (this is correct) 0.0676676 (this is wrong) </p> <p> I have double read the boost::math documents, to make sure that I didn't misused the library. Hopefully I am not making a stupid mistake here. Otherwise, the bug looks so stupid to me that I still don't believe this is a bug in boost::math, instead I did something wrong here. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6151 Trac 1.4.3 Yan Zhou <zhouyan@…> Sat, 19 Nov 2011 21:42:23 GMT attachment set https://svn.boost.org/trac10/ticket/6151 https://svn.boost.org/trac10/ticket/6151 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">laplace.patch</span> </li> </ul> <p> fix the bug </p> Ticket Yan Zhou <zhouyan@…> Sat, 19 Nov 2011 21:59:33 GMT component changed; owner set https://svn.boost.org/trac10/ticket/6151#comment:1 https://svn.boost.org/trac10/ticket/6151#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">math</span> </li> </ul> Ticket John Maddock Sun, 20 Nov 2011 13:18:54 GMT owner changed https://svn.boost.org/trac10/ticket/6151#comment:2 https://svn.boost.org/trac10/ticket/6151#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Paul A. Bristow</span> </li> </ul> <p> Ouch. Nasty bug. </p> <p> Paul, did you work on this one? I can't remember now, except I don't think I've touched it... </p> Ticket Paul A. Bristow Sun, 20 Nov 2011 14:56:35 GMT <link>https://svn.boost.org/trac10/ticket/6151#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6151#comment:3</guid> <description> <p> OK, looks like a bug, and I think I wrote it, so will look at it soon. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Mon, 21 Nov 2011 12:59:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6151#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6151#comment:4</guid> <description> <p> Ok I did some work on this, but Thijs did most of it ;-) </p> <p> Thanks for Yan Zhou for patch which looks good. Test adjusted (previous test was wrong too) and now passes cdf + complement == 1 for a range of scale, location, x and p, cdf and quantiles. </p> <p> Both committed to trunk At revision: 75592 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Tue, 22 Nov 2011 10:32:03 GMT</pubDate> <title>status, milestone changed; keywords, resolution set https://svn.boost.org/trac10/ticket/6151#comment:5 https://svn.boost.org/trac10/ticket/6151#comment:5 <ul> <li><strong>keywords</strong> laplace distribution added </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> </ul> Ticket