Skip to content

Commit

Permalink
Fix when search for root in interval containing zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoops committed Mar 13, 2019
1 parent 9fb9c65 commit 11ba5f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion copasi/utilities/CBrent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool CBrent::findRoot(double a, // Left border
while ((fabs(b - a) > vTol || fabs(fb - fa) > fTol) &&
fb != 0.0 &&
fs != 0.0 &&
fabs(b - a) > fabs(b + a) * 50.0 * std::numeric_limits< double >::epsilon())
fabs(b - a) > (fabs(b) + fabs(a)) * 50.0 * std::numeric_limits< double >::epsilon())
{
if (fa != fc && fb != fc)
{
Expand Down

0 comments on commit 11ba5f0

Please sign in to comment.