[Boost-bugs] [Boost C++ Libraries] #10046: halley iteration

Subject: [Boost-bugs] [Boost C++ Libraries] #10046: halley iteration
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-12 15:38:14


#10046: halley iteration
------------------------------+-------------------------
 Reporter: Di <cao.96@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: math
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+-------------------------
 When I use the halley iteration, it is coded as follows,

 if(f1 != 0 && f2 != 0)
 {
   // Oops zero derivative!!!
 }
 else
 {
     if(f2 != 0)
     {
         ...
         T num = 2 * f1 - f0 * (f2 / f1);
         ...
     }
     else
     {
         delta = f0 / f1;
     }
 }

 But there is no case for f1 == 0, so this might cause division by zero.
 The code should handle this case gracefully.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10046>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC