From 10fc4e4d85b923b1920f688ba9023dce58788ca9 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sat, 20 Jun 2015 22:30:12 +0200 Subject: [PATCH] Stop iterations also if interval is small (1.0e-6). --- src/cterror/cterror.cpp | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/src/cterror/cterror.cpp b/src/cterror/cterror.cpp index 6734dec..c014762 100644 --- a/src/cterror/cterror.cpp +++ b/src/cterror/cterror.cpp @@ -593,6 +593,11 @@ double cterror::error_bisection(const double& min, const double& max) break; } + // Check if interval is smaller than 1.0e-6 + if (std::abs(wrk_max-wrk_min) < 1.0e-6) { + break; + } + // If we are on the crescent side of the parabola ... if (mid > m_value) { -- libgit2 0.21.4