Repository navigation
Conversation
The inverse quadratic interpolation step used the left bracket end `a` where Brent's algorithm has `q = fa/fc`. The bad step was still screened by the acceptance tests, so roots stayed bracketed and within tolerance, but convergence took up to ~3x more function evaluations and depended on where the bracket sat on the x axis. Matches Burkardt's 2013 fix and FMM zeroin. Fixes #1064 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Values taken from CI make check output (identical on Linux and macOS, with and without OpenMP). All three roots remain within the tests' epsx tolerances; Brent now stops sooner instead of over-converging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Updated
The new roots are slightly less over-converged because Brent now reaches the tolerance in fewer steps. All of them are still well within each test's tolerance. |
Values from CI make check (identical on Linux and macOS). The eosDT_get_T logP inversion still meets its tol = 1d-5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
CI is now green on all four SDK builds. Besides I haven't run the star test suite: it's |
|
Closing as a duplicate of #1065, which contains the same solver correction. We can keep the remaining TestHub/EOS investigation there, however the testing/timing in this pr is still useful to that discussion. |
Fixes #1064
The inverse quadratic interpolation branch of
eval_brent_safe_zero(num/private/mod_brent.f90) used the left bracket enda, which the routine never updates, where Brent's algorithm hasq = fa/fc:This matches Burkardt's own 2013 fix to
zeroand FMMzeroin(2.0d0*xm*q*(q - r)).The bad step was still screened by Brent's acceptance tests, so roots stayed bracketed and within the requested tolerance. Convergence was just slower, and how much slower depended on where the bracket sat on the x axis. This affects every
safe_root*/brent_safe_zerocaller, including EOS inversions,pre_ms_model,rsp_buildandpgbinary_orbit.Testing
I built the real routine standalone with gfortran, from
mainand from this branch, and counted function evaluations (bracket,t = 1e-12):The
test_brent_zerocases in thenumunit tests still converge to |f(z)| < 1e-14, so they stay silent in the output.Expected follow-ups
num/test/test_output: thetest_root/safe_root*lines print roots to 16 digits, and they change in the last digits. All results remain within the tests'epsx/epsy. The golden file was made with crmath, which I don't have locally. I'll update it from CI'smake checkoutput.🤖 Generated with Claude Code