Boost C++ Libraries: Ticket #4879: Apparent bugs in ibeta_inv_imp (math::specialfunctions) https://svn.boost.org/trac10/ticket/4879 <p> Hi, </p> <p> There seem to be a couple of bugs in the above function (which is in boost\math\special_functions\detail\ibeta_inverse.hpp): </p> <p> The first is the condition: </p> <p> <strong>if((lambda &gt;= 0.2) &amp;&amp; (lambda &lt;= 0.8) &amp;&amp; (lambda &gt;= 10))</strong> </p> <p> This clearly can never evaluate to true (lambda &lt;= 0.8 AND &gt;= 10) - so the following code block can never be executed. I'm guessing that the third lambda should be replaced with <strong>r</strong> (a parameter defined a couple of lines higher which could reasonably satisfy the condition) - but I'm not a mathematician and so this is just a guess. </p> <p> The second apparent problem is an inconsistency in the handling of the boolean flag <strong>invert</strong>. Initially set to <em>false</em>, in some parts of the code it is toggled to its complement whenever parameters <strong>a</strong> and <strong>b</strong> are swapped (which can happen more than once). However in other parts of the code it is simply set to <em>true</em>. Again I'm afraid I don't know enough to be sure that the latter is wrong, but changing all instances where it is set to <em>true</em> to instead set it to its complement fixes a problem I was getting with the Fisher_F distribution which relies on this function. </p> <p> Could someone with more understanding than me of what's going here have a look at these ? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4879 Trac 1.4.3 anonymous Mon, 22 Nov 2010 16:30:58 GMT <link>https://svn.boost.org/trac10/ticket/4879#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4879#comment:1</guid> <description> <p> I believe you're correct on both counts - using r for the conditional agrees with my notes - and setting invert = !invert is a safer approach than we have now - it looks like this got broken when we added another inversion method as an optimisation which broke the invert == false precondition - looks like the issue can only be triggered when a == 0.5 and b &lt; 0.5 - does this ring a bell? </p> <p> John Maddock </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 22 Nov 2010 16:31:47 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4879#comment:2 https://svn.boost.org/trac10/ticket/4879#comment:2 <ul> <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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66685" title="Fixes #4879.">[66685]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4879" title="#4879: Bugs: Apparent bugs in ibeta_inv_imp (math::specialfunctions) (closed: fixed)">#4879</a>. </p> Ticket