Boost C++ Libraries: Ticket #11532: toms748_solve produces -nan when evaluating a smooth function in a fixed interval https://svn.boost.org/trac10/ticket/11532 <p> In my algorithm that is finding the point where two gamma gamma distributions crosses, the toms748 solver produces a -nan value for the evaluation point. The behaviour occurs quite rarely, and only for extremely specific values of the governing parameters. I have not checked if the problem is cross platform. </p> <p> I see that the solver evaluates the same point twice, and suspect that the subsequent calculation of the change of the evaluation point somehow divides by 0. </p> <p> A minimal example is enclosed. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11532 Trac 1.4.3 Ola Skavhaug <ola@…> Mon, 10 Aug 2015 10:21:15 GMT attachment set https://svn.boost.org/trac10/ticket/11532 https://svn.boost.org/trac10/ticket/11532 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> <p> Minimal example, compile with: g++ -std=c++11 -fPIC -O2 -o test test.cpp </p> Ticket anonymous Tue, 11 Aug 2015 11:26:41 GMT <link>https://svn.boost.org/trac10/ticket/11532#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11532#comment:1</guid> <description> <p> can confirm, same bug, ubuntu 14.04 and gcc </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 11 Aug 2015 12:31:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11532#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11532#comment:2</guid> <description> <p> Thanks, I tried to reproduce with msvc but no luck, I'll look into GCC later. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 11 Aug 2015 17:20:05 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11532#comment:3 https://svn.boost.org/trac10/ticket/11532#comment:3 <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> There's a typo/bug in the root bracketing code, fixed in <a class="ext-link" href="https://github.com/boostorg/math/commit/8a29241cc3a59fe04b10ab6937d8eefe07dd85fb"><span class="icon">​</span>https://github.com/boostorg/math/commit/8a29241cc3a59fe04b10ab6937d8eefe07dd85fb</a> </p> <p> Note this will not be in the next release which already in beta. </p> Ticket