Commit 10fc4e4d85b923b1920f688ba9023dce58788ca9
1 parent
d75e51d0
Stop iterations also if interval is small (1.0e-6).
Showing
1 changed file
with
5 additions
and
0 deletions
src/cterror/cterror.cpp
| @@ -593,6 +593,11 @@ double cterror::error_bisection(const double& min, const double& max) | @@ -593,6 +593,11 @@ double cterror::error_bisection(const double& min, const double& max) | ||
| 593 | break; | 593 | break; |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | + // Check if interval is smaller than 1.0e-6 | ||
| 597 | + if (std::abs(wrk_max-wrk_min) < 1.0e-6) { | ||
| 598 | + break; | ||
| 599 | + } | ||
| 600 | + | ||
| 596 | // If we are on the crescent side of the parabola ... | 601 | // If we are on the crescent side of the parabola ... |
| 597 | if (mid > m_value) { | 602 | if (mid > m_value) { |
| 598 | 603 |