summaryrefslogtreecommitdiff
path: root/log-fourier_integrator.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-19 17:03:00 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-19 17:03:00 -0300
commit4d350279c9ba8e0b02a4b853b41e5bf8303083dc (patch)
tree99e21bad7dbc69ca473e2044acd3719ac324f5e5 /log-fourier_integrator.cpp
parente22e45c8c20185260c6bc5f304915dd5d321eb5f (diff)
downloadcode-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.tar.gz
code-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.tar.bz2
code-4d350279c9ba8e0b02a4b853b41e5bf8303083dc.zip
Don't rely on past output for μ
Diffstat (limited to 'log-fourier_integrator.cpp')
-rw-r--r--log-fourier_integrator.cpp19
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) {