vvsandClaude Opus 5 9884b21204 PREREG_flat_twice outcome: stage 1 passed (twice-in-a-row fires on 27.8% of model steps on the flat families, 8.7% on APS, 4.3% on fun1; flat/APS ratio 3.20 against the single flag's 2.47), stage 2 FAILED: under the projection APS 2806 -> 2803 (W2 holds, the per-problem edge over Chandrupatla kept at 83/28/42) but CHA 3220 -> 3341 and the flat families 1823 -> 1975 (W1, W4 fail); with G2 the same. Under safe/step the twice gate is inert (3390 -> 3388) where the single one gave 3037.
Mechanism: the flat cycle is undershoot, undershoot, crossing, near-empty step. The single flag fires after the first undershoot and replaces the second - a useless step; the twice flag fires after the second and replaces the CROSSING, the one step of the cycle that collapses the bracket. The second undershoot's r is ~0.26, next to the 1/4 threshold, so the pair often does not even form. Again a detectability gain that did not carry to run cost. Next candidate (not pre-registered): the unkept promise AND a creep - the same step moving the same way as the previous one.

Removed a vacuous pin I had written (s2 <= max(s1, s2)). Regression on the branch: 935 pass twice; the only red test is the paper-number check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 13:45:20 +01:00

sim-numerics — similarity as a step rule for root finding

Artifact for the paper article/sim_numerics.tex. Every claim in the paper is produced by one of the scripts below; nothing in the text is transcribed by hand, and verify_article.py checks all 72 stated numbers against the run data as part of the test suite.

Reproducing

python -m pytest tests/ -q          # 490 tests
python sweep_full.py                # the full grid, writes sweep_full.json
python verify_article.py            # every paper number vs the data

Heavy runs go to a Linux machine (Python 3.12, run detached with a log, setsid nohup ... > sweep.log 2>&1). Use one platform for all numbers: the test functions call libm, whose last digit differs between Windows and Linux, and the same SciPy version scores 2819 for TOMS 748 on Windows against 2820 on Linux for the same set. The paper's numbers are the Linux ones.

Where each claim comes from

Paper Claim Script
Prop. 1 the two-point similarity step is regula falsi tests/test_simroot.py::test_the_pure_two_point_similarity_step_is_regula_falsi_exactly
Prop. 2, Table 1 contraction law, predicted 0.1716 vs measured 0.1716 stage0c_why_pure_fails.py
Cor. 1 a chosen similarity fails on 5–8 of 8 problems stage0b_pure_similarity.py
Cor. 2 faster similarity is not better (sqrt, cbrt) stage0d_derived_similarity.py
Cor. 3 derived scale ⇒ the step is |f|/|f'| ⇒ superlinear stage0d_derived_similarity.py, stage0e_guard_cost.py
§3 safeguards bracket vs step vs both, and what each costs stage2_guard_modes.py, stage3_bound_check.py
§3 order 1.584 (2-point) vs 1.944 (3-point) stage5_three_point.py
§3.1 project vs replace; the guarantee costs nothing stage6_projection.py
§3.1 the projection invariant, instrumented per step stage6b_invariant.py
§4 fairness ITP is not handicapped; κ₁ and n₀ sweeps stage2b_itp_fairness.py
Tables 2, 3 the 154-configuration ranking on both sets sweep_full.py → report_sweep.py
Table 4 the law across the whole grid sweep_full.py → report_sweep.py
§6 approach vs endgame, order, boldness, step quality stage4_why.py
§7.1 the prototype-aggregation form loses 0/6/147 bench_full.py (SIM.pair2d.*)
§7.2 the 2× bound and high order are incompatible stage5_three_point.py, tests/test_three_point.py
§7.4 the symmetric ratio similarity degenerates simroot/pure.py (PURE_SIMS["ratio"] docstring), stage0d

Layout

simroot/pure.py       the method: one similarity, one step rule, three guards
simroot/baselines.py  bisection, 4 false-position variants, Ridders, Brent,
                      TOMS 748 (SciPy), ITP (own, validated against its theorem)
simroot/sim.py        the prototype-aggregation form — a NEGATIVE result, kept
                      because the paper reports it
stage0*..stage5*      the derivation, in the order it was actually established
bench_full.py         17 methods on both sets
sweep_full.py         9 similarities x 4 scales x 4 guards + 10 baselines
report_sweep.py       reads sweep_full.json, produces the paper's tables
verify_article.py     asserts the paper against the data (72 checks)
tests/                490 tests; every bug found in audit is pinned here

Negative results, so they are not reopened

  1. Similarity normalised by the two bracket ends is regula falsi, identically.
  2. A faster-changing similarity is not better; what matters is the slope of 1 - S at zero matching the problem, and only the data supplies it.
  3. Prototype-pair aggregation with softmax over the whole memory loses to the simplest form: 0 wins / 6 ties / 147 losses against Brent on APS.
  4. "Our safeguard fires less often" — refuted: Brent discards 53% of its interpolations on the set it wins, 34% on the set it loses.
  5. "Our steps are bolder" — refuted: on Chandrupatla Brent is bolder (56.3% against 41.8%) and still loses. The mechanism is step quality: median bracket removed 0.275 against 0.058.
  6. Every safeguard that REPLACES the computed step with a midpoint destroys the order: with the three-point scale, order falls from 1.94 to 1.00 and the APS total from 2806 to 7260. Resolved by projecting the step onto the admissible interval instead (guard="project"), which costs nothing on APS (2806 either way) and gains on Chandrupatla (40/45 at 3220 against 35/45 at 4104 unguarded).
  7. Zero slack in the projection is degenerate: a worst case of exactly bisection demands a halving at every step, leaving the projection no freedom.
  8. Writing the projection as a radius around the midpoint instead of a clamp loses the invariant to cancellation — a relative 8.9e-5 overshoot on eleven Chandrupatla problems.
S
Description
Guaranteed bracketing root finder: beats Brent, TOMS 748 and Chandrupatla on multiple roots. Python/Cython, reproducible benchmarks, Apache-2.0.
https://doi.org/10.5281/zenodo.22894336 Readme Apache-2.0
5.8 MiB
Languages
Python 87.7%
TeX 10.4%
Cython 1.3%
Shell 0.6%