From 4d350279c9ba8e0b02a4b853b41e5bf8303083dc Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 19 Apr 2025 17:03:00 -0300 Subject: Don't rely on past output for μ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- log-fourier_integrator.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'log-fourier_integrator.cpp') diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp index 37a28eb..9e9e46d 100644 --- a/log-fourier_integrator.cpp +++ b/log-fourier_integrator.cpp @@ -146,15 +146,20 @@ int main(int argc, char* argv[]) { break; } if (μ₁ == 0 || μ₂ == 0) { - if (μ₁ == 0 && Cₜ[0] > 1) { - /* We found a lower bound */ - μ₁ = μ; + if (Cₜ[0] > 1) { + if (μ₁ == 0) { + /* We found a lower bound */ + μ₁ = μ; + } + μ *= 1.01; } - if (μ₂ == 0 && Cₜ[0] < 1) { - /* We found an upper bound */ - μ₂ = μ; + if (Cₜ[0] < 1) { + if (μ₂ == 0) { + /* We found an upper bound */ + μ₂ = μ; + } + μ /= 1.01; } - μ *= sqrt(sqrt(std::abs(Cₜ[0]))); } else { /* Once the bounds are set, we can use bisection */ if (Cₜ[0] > 1) { -- cgit v1.2.3-70-g09d2