diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-19 17:03:00 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-19 17:03:00 -0300 |
commit | 4d350279c9ba8e0b02a4b853b41e5bf8303083dc (patch) | |
tree | 99e21bad7dbc69ca473e2044acd3719ac324f5e5 | |
parent | e22e45c8c20185260c6bc5f304915dd5d321eb5f (diff) | |
download | code-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.tar.gz code-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.tar.bz2 code-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.zip |
Don't rely on past output for μ
-rw-r--r-- | log-fourier_integrator.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
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) { |