Files
sim-numerics/apply_article_revision1.py
T
vvsandClaude Opus 5 862feaff86 Revision 1, step 1: one scoring criterion, the correct order, and the internal inconsistencies.
Point 1. The base step's order is Muller's 1.839, not 2: the derivative of the parabola through
the last three points errs by f'''/6 (x_n - x_{n-1})(x_n - x_{n-2}) = O(e_{n-1} e_{n-2}).
order_high_precision.py (3000 digits, to 1e-2900): 1.840 on cos x - x, e^x - 2, x^3 - x - 2,
sin x - 1/2; 2.000 only on x^2 - 2; two-point 1.618. The double-precision medians (2.000, 1.94)
are removed from the text.

Point 3. Every protocol number is re-scored under the criterion of section 9 - a sign change
within 1e-6 or f(x) == 0. rescore_uniform.py re-runs all 2779 distinct configurations of the 25
protocol sweeps on APS and CHA (the runs did not keep x) -> sweep_uniform.json, same row format;
it reproduces the APS/CHA lines of Table 10 exactly (built-in check). verify_article.py,
audit_similarity_places.py and the gap diagnostics read the re-scored data; the multiplier and
endowment measurements score by the same criterion. Table 7 (two criteria side by side) is gone;
7.3 now explains why the criterion is a sign change. Consequences stated in the text: the base
rule 2634 / 2357 against Chandrupatla 2595 / 1505 (1.5% behind on APS, no longer "level"); A'
2259 / 1074 (12.9% and 28.6% below Chandrupatla); the defect reading 2351 is second to the
shape reading 2337, not the record; the remembered analogy is level with no regime (2633 vs
2634) under this criterion; Table 9a's range is 19% to 425%.

Point 8. report_sweep.head_to_head counts every problem, failures charged (it counted only the
problems both methods solved, which is why Table 8 rows summed to 153 and 40). Family-level
comparisons added (A' vs Chandrupatla 8/1/6 of 15 and 7/0/2 of 9 families, not significant), and
an independence paragraph in section 9.

Point 11. sweep_itp.py: ITP (recommended constants and per-problem oracle) on all six corpora ->
Table 10; behind A' on every corpus, 0 bound violations.

Points 7, 9, 10 and the internals: the 2x bound is ours, not the rivals' promise; the law
predicts the group order only; "outside the proven bracket" explained (narrowest bracket of all
observed signs); 7.4's fun1 paragraph corrected (five costs under safe; the unguarded numbers
belong to fun1.4, fun1.5 and to fun3.1, fun5.1 separately); Table 1's last cell; the corpus-4
composition and odd multiplicities stated, also in the abstract.

build_tex.py: pdflatex output decoded with errors="replace" (a UTF-8 character cut by TeX's log
wrap crashed the build). Table 10 column widths rebalanced.

Checks: verify_article on the server 500 OK / 0 BAD (467 existing with the new values, 33 new);
regression x2 on the server 1232 passed, 0 failed; PDF 28 pages, 0 errors, 0 undefined, 0 overfull.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 07:01:36 +01:00

237 lines
61 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Revision 1, step 1 (2026-09-22): corrections that need no new method.
point 1 the order of the base step is Muller's 1.839, not 2 (order_high_precision.py)
point 3 ONE criterion throughout: a sign change within 1e-6 or f(x) == 0
(rescore_uniform.py -> sweep_uniform.json); every protocol number re-scored
point 7 the 2x bound is ours, not the rivals' promise
point 8 head-to-head over every problem, failures charged; families as the unit
point 9 the law predicts the group order, not the order within groups
point 10 "outside the proven bracket" explained
point 11 ITP in Table 10 (sweep_itp.py)
internal Table 8 sums, section 7.4, Table 5 vs Table 7, Table 1's "captured" cell
Exact anchors, each found exactly once, or nothing is written.
python -u apply_article_revision1.py
"""
from __future__ import annotations
PATH = "article/sim_numerics.md"
REPL = []
def R(old, new):
REPL.append((old, new))
# ---------------------------------------------------------------- abstract
R("Second, any similarity fixed in advance with the scale also fixed yields at best linear convergence at a rate that is a property of the problem rather than of the method; on the eight standard problems of §2.2, five to eight of them fail. Third,",
"Second, any similarity fixed in advance with the scale also fixed yields at best linear convergence at a rate that is a property of the problem rather than of the method. Third,")
R("It carries a proven worst case of twice bisection plus one step and exactly one free constant, which we declare rather than argue away: the multiplier of that budget. On the 154 problems of Alefeld, Potra and Shi it needs 2806 evaluations of $f$ against 2820 for TOMS 748, 2889 for Brent and 2787 for Chandrupatla's method — level in total — and beats Chandrupatla problem by problem 87 to 42 (exact sign test $p=9\\cdot10^{-5}$). On the 45 wide-bracket problems of Chandrupatla it beats Brent and TOMS 748 and loses to ITP and to Chandrupatla (3220 against 2896 and 2441). For every data-derived scale, the ranking of the nine similarity functions matches the derived law without exception.",
"Its order is Muller's, 1.839. It carries a proven worst case of twice bisection plus one step and one free numerical constant, the multiplier of that budget, which we declare. On the 154 problems of Alefeld, Potra and Shi it needs 2634 evaluations of $f$ against 2636 for TOMS 748, 2707 for Brent and 2595 for Chandrupatla's method; it wins more problems than it loses against Chandrupatla, 87 to 43, and needs 1.5% more in total because its losses are the larger ones. On the 45 wide-bracket problems of Chandrupatla it beats Brent and TOMS 748 and loses to ITP and to Chandrupatla (2357 against 1946 and 1505). For every data-derived scale the three similarity functions whose $1-S$ has a non-zero slope at the origin come before the three whose slope is zero, as the derived law predicts.")
R("On the two sets it needs 2438 and 2005 evaluations against Chandrupatla's 2787 and 2441 and beats him problem by problem on both, 103 to 30 and 29 to 7.",
"On the two sets it needs 2259 and 1074 evaluations against Chandrupatla's 2595 and 1505 and wins more problems than it loses on both, 103 to 31 and 31 to 10.")
R("tested once, after its code was frozen, on 240 problems from six new families, it needs 3656 evaluations against Chandrupatla's 5717 and wins 177 problems to 28. Over 855 problems in six corpora it is ahead of Brent, TOMS 748 and the recent ModAB everywhere and keeps its bound where they break theirs on 118, 84 and 9 problems;",
"tested once, after its code was frozen, on 240 problems from six new families, it needs 3656 evaluations against Chandrupatla's 5717 and wins 177 problems to 28 — a corpus the author composed knowing where the method is strong: two of its six families have multiple or fractional roots, and without them the lead is 2403 against 3569, on the simple-root families alone 737 against 747. Over 855 problems in six corpora it is ahead of Brent, TOMS 748, ITP and the recent ModAB everywhere and stays within its own bound of twice bisection on every problem, a bound that Brent, TOMS 748 and ModAB, which do not promise it, exceed on 118, 84 and 9 problems;")
R("and the similarity that sets the step, whose form is decisive (replacing it costs 12% to 315%).",
"and the similarity that sets the step, whose form is decisive (replacing it costs 19% to 425%).")
R("with the tent the step is Newton's, with any of the other eight functions the same method costs from 12% to four times more.",
"with the tent the step is Newton's, with any of the other eight functions the proposed method costs from 19% to five times more.")
R("and in the proposed method replacing the tent by any other function costs 12% to 315% (Table 9a).",
"and in the proposed method replacing the tent by any other function costs 19% to 425% (Table 9a).")
# ---------------------------------------------------------------- section 2
R("So \"a similarity rule scaled by the bracket is not a new method\" would be too broad a conclusion, and this paper's own Table 3 refutes it — bracket-scaled configurations take first and fourth place on Chandrupatla and one of them solves 41 of 45, where false position solves 6.",
"So \"a similarity rule scaled by the bracket is not a new method\" would be too broad a conclusion, and this paper's own Table 3 refutes it — bracket-scaled configurations take third, fourth and sixth place on Chandrupatla's set, where false position solves 6 of 45.")
R("In our measurements plain false position solves 127 of the 154 Alefeld–Potra–Shi problems, against 153 for bisection.",
"In our measurements plain false position solves 127 of the 154 Alefeld–Potra–Shi problems, against 154 for bisection.")
R("| $\\max(0,1-\\lvert z\\rvert)$ | 1 | rate 0.1716 | captured, see below |",
"| $\\max(0,1-\\lvert z\\rvert)$ | 1 | rate 0.1716 | fails: stays at $x_\\mathrm{far}$ |")
R("yet over the full benchmark they finish at 10497 and 11941, ahead of all three $c=0$ similarities at 14314, 15102 and 16394, and one of them heads Table 3. Overshooting is the milder failure.",
"yet over the full benchmark (best over scales, Table 4) they finish at 9411 and 10874, ahead of all three $c=0$ similarities at 13187, 13990 and 15272. Overshooting is the milder failure.")
# ---------------------------------------------------------------- section 3: the order (point 1)
R("has error $O(h^2)$. A Newton step whose derivative carries an $O(h^2)$ error satisfies $e' = e-f/\\hat f' = e-(e-ce^2+\\dots)(1+O(e^2)) = ce^2+O(e^3)$, so the predicted order is **2** — not Muller's 1.84, which belongs to a method using the parabola's *root* rather than its *derivative*. Measured medians are 1.584 for the two-point scale and 2.000 for the three-point, against 1.809 for Brent and 2.654 for TOMS 748.",
"has error $\\tfrac16 f'''(\\eta)\\,(x_n-x_{n-1})(x_n-x_{n-2})$, that is $O(e_{n-1}e_{n-2})$. The Newton step with that derivative satisfies $e_{n+1}=\\tfrac{f''}{2f'}e_n^2+\\tfrac{f'''}{6f'}\\,e_n e_{n-1}e_{n-2}+\\dots$; the second term dominates, and the order is the root of $p^3=p^2+p+1$, $p\\approx1.839$ — **Muller's order**, as it should be, since the step uses the same parabola as Muller's method, through its derivative rather than its root. Only where the parabola is exact ($f'''=0$) does the order rise to Newton's 2. Carried to $10^{-2900}$ in 3000-digit arithmetic (`order_high_precision.py`), the computational order per step settles at 1.840 on $\\cos x-x$, $e^x-2$, $x^3-x-2$ and $\\sin x-\\tfrac12$ and at 2.000 on $x^2-2$; the two-point scale settles at 1.618. In double precision a run takes three or four superlinear steps before it reaches the tolerance, too few to tell 1.84 from 2, and we report no order measured there.")
R("(i) a derivation that fixes every choice — which similarity, which scale, which safeguard — before any benchmark is consulted, and then predicts the ranking of all nine similarity functions correctly;",
"(i) a derivation that fixes every choice — which similarity, which scale, which safeguard — before any benchmark is consulted, and predicts which similarity functions come first;")
R("With the three-point scale, replacing on that test drops the observed order from 1.94 to 1.00 and the Alefeld–Potra–Shi total from 2806 to 7260 — worse than bisection.",
"With the three-point scale, replacing on that test makes the convergence linear and takes the Alefeld–Potra–Shi total from 2634 to 7068 — nearly the cost of bisection (7338).")
R("**The multiplier is the method's one free constant.** An earlier version of this section argued that it is \"the factor already claimed in the bound\". That is circular — the bound is twice bisection because two was chosen — and measurement settles it (`measure_budget_factor.py`, Linux):",
"**The multiplier is the method's one free numerical constant.** It is not \"the factor already claimed in the bound\" — that argument is circular, the bound is twice bisection because two was chosen — and measurement settles it (`measure_budget_factor.py`, Linux):")
R("| 1 | 4817 | 2997 | 7814 |\n| 1.25 | 2806 | 2752 | 5558 |\n| 1.5 | 2806 | 2889 | 5695 |\n| 2 | 2806 | 3220 | 6026 |\n| 3 | 2806 | 3756 | 6562 |\n| 4 | 2806 | 4006 | 6812 |",
"| 1 | 4625 | 2039 | 6664 |\n| 1.25 | 2626 | 1822 | 4448 |\n| 1.5 | 2636 | 1991 | 4627 |\n| 2 | 2634 | 2357 | 4991 |\n| 3 | 2634 | 2936 | 5570 |\n| 4 | 2634 | 3229 | 5863 |")
R("On the canonical set the projection never binds once $c\\ge1.25$, so the total does not move. On the wide-bracket set it moves monotonically with $c$, and 2 is not even the best value. Nor is zero slack ($c=1$) the degenerate case it was claimed to be, \"a worst case of exactly bisection\" under which \"the guard behaves as bisection\": it costs 4817 and 2997, far from bisection's 7530 and 3090, and on the wide-bracket set it beats $c=2$.",
"On the canonical set the projection binds on one problem only once $c\\ge1.25$ — `aps.13.00`, whose $f$ underflows to zero around the root (20, 30 and 28 evaluations at $c=1.25$, 1.5 and 2) — so the total barely moves. On the wide-bracket set it moves monotonically with $c$ from 1.25 on, and 2 is not the best value. Nor is zero slack ($c=1$) a degenerate case under which the guard behaves as bisection: it costs 4625 and 2039, far from bisection's 7338 and 2136, and on the wide-bracket set it beats $c=2$.")
R("| 0.1 | bisection + 1 step | 5344 | 3051 | 8395 |\n| 0.5 | bisection + 1 step | 4656 | 3002 | 7658 |\n| **1** | **bisection + 1 step** | **3568** | **3020** | **6588** |\n| 2 | bisection + 2 steps | 3692 | 2712 | 6404 |\n| 5 | bisection + 5 steps | 3006 | 2615 | 5621 |",
"| 0.1 | bisection + 1 step | 5150 | 2097 | 7247 |\n| 0.5 | bisection + 1 step | 4462 | 2037 | 6499 |\n| **1** | **bisection + 1 step** | **3377** | **2073** | **5450** |\n| 2 | bisection + 2 steps | 3502 | 1757 | 5259 |\n| 5 | bisection + 5 steps | 2819 | 1666 | 4485 |")
R("We nonetheless propose the scheduled projection with $c=2$ and declare its multiplier. On the canonical set it is 762 evaluations cheaper than the earned variant (2806 against 3568), and there its total does not depend on the multiplier at all; on the wide-bracket set the earned variant is the cheaper (3020 against 3220). The two are the ends of a trade stated in numbers: one declared constant and the better canonical result, or no constant, a tighter bound and the better wide-bracket result. The value 2 was fixed before any benchmark was consulted; what changed after the question whether it was load-bearing is only that it is now declared as a constant rather than argued to be none.",
"We nonetheless propose the scheduled projection with $c=2$ and declare its multiplier. On the canonical set it is 743 evaluations cheaper than the earned variant (2634 against 3377), and there its total barely depends on the multiplier; on the wide-bracket set the earned variant is the cheaper (2073 against 2357). The two are the ends of a trade stated in numbers: one declared constant and the better canonical result, or no constant, a tighter bound and the better wide-bracket result. The value 2 was fixed before any benchmark was consulted.")
# ---------------------------------------------------------------- section 4: the criterion (point 3)
R("**Cost model.** Evaluations of $f$. A run counts as solved when it reports convergence and lands within $10^{-6}$ of the published root; $x$-tolerance $10^{-12}$; budget 200 evaluations.",
"**Cost model.** Evaluations of $f$. A run counts as solved when it reports convergence and $f$ changes sign within $10^{-6}$ of the returned point, or vanishes there — the bracketing notion of a root, the same criterion on every corpus of this paper; $x$-tolerance $10^{-12}$; budget 200 evaluations. Scoring against the published root instead, as the benchmarks' harness does, charges every method the full budget on six problems where $f$ vanishes identically around the root in floating point (§7.3). Head-to-head counts (wins/ties/losses) are taken over every problem of a set with the same charging as the totals.")
R("With the tolerance corrected our implementation and the library agree on all 199 problems exactly, and Chandrupatla's totals move from 2785 to 2787 on the canonical set and from 2423 to 2441 on the wide-bracket set. For Brent the library is slightly dearer than our implementation (7004 against 6991 over both sets); we use the library anyway, because it is the implementation a reader can check.",
"With the tolerance corrected our implementation and the library agree on all 199 problems exactly. For Brent the library is slightly dearer than our implementation; we use the library anyway, because it is the implementation a reader can check.")
# ---------------------------------------------------------------- section 5: Tables 2, 3
R("| 1 | Chandrupatla | no | 153/154 | 2787 | 0 |\n| 2 | the same rule with no safeguard at all | no | 153/154 | 2806 | 0 |\n| **3** | **base rule: tent, 3-point, projection ($c=2$)** | **no** | 153/154 | **2806** | 0 |\n| 4 | TOMS 748 | yes | 153/154 | 2820 | 0 |\n| 5 | Brent | yes | 153/154 | 2889 | 0 |\n| 12 | Dekker | no | 153/154 | 3158 | 0 |\n| 13 | ITP, per-problem oracle | yes | 153/154 | 3260 | 0 |\n| 20 | Ridders | no | 153/154 | 3313 | 0 |\n| 29 | constant-free variant: earned projection | no | 153/154 | 3568 | 0 |\n| 34 | ITP, recommended constants | yes | 153/154 | 3957 | 0 |\n| 73 | Illinois | yes | 153/154 | 7045 | 0 |\n| 79 | bisection | no | 153/154 | 7530 | 0 |\n| 244 | false position | no | 127/154 | 10560 | — |",
"| 1 | Chandrupatla | no | 154/154 | 2595 | 0 |\n| 2 | the same rule with no safeguard at all | no | 154/154 | 2634 | 0 |\n| **3** | **base rule: tent, 3-point, projection ($c=2$)** | **no** | 154/154 | **2634** | 0 |\n| 4 | TOMS 748 | yes | 154/154 | 2636 | 0 |\n| 5 | Brent | yes | 154/154 | 2707 | 0 |\n| 11 | ITP, per-problem oracle | yes | 154/154 | 3068 | 0 |\n| 15 | Ridders | no | 154/154 | 3124 | 0 |\n| 25 | constant-free variant: earned projection | no | 154/154 | 3377 | 0 |\n| 29 | ITP, recommended constants | yes | 154/154 | 3767 | 0 |\n| 73 | bisection | no | 154/154 | 7338 | 0 |\n| 232 | Dekker | no | 153/154 | 3158 | 0 |\n| 237 | Illinois | yes | 153/154 | 7045 | 0 |\n| 244 | false position | no | 127/154 | 10560 | — |")
R("The base rule and the same rule without any safeguard tie at 2806: the projection never binds on this set. By total, Chandrupatla's method is first with 2787, 0.7% fewer — the same order of margin as the 0.5% by which the base rule leads TOMS 748, which we read as a tie. Problem by problem the picture is the other way round: on the problems both solve the base rule beats Chandrupatla 87/24/42 (wins/ties/losses; exact two-sided sign test $p=9\\cdot10^{-5}$), TOMS 748 86/16/51, Brent 102/11/40, ITP at its recommended constants 132/3/18, the per-problem ITP oracle 121/4/28, and bisection 152/1/0. It wins twice as many problems as it loses against Chandrupatla and trails him in total because its losses are the larger ones. The constant-free variant goes 79/3/71 against Chandrupatla ($p=0.57$, a tie in problems), 77/9/67 against TOMS 748 and 78/5/70 against Brent, and loses on the total to all three.",
"The base rule and the same rule without any safeguard tie at 2634: the projection never binds on this set. By total, Chandrupatla's method is first with 2595, 1.5% fewer; the base rule and TOMS 748 are level (2634 against 2636). Problem by problem the base rule wins against Chandrupatla 87/24/43 (wins/ties/losses; exact two-sided sign test $p=1.4\\cdot10^{-4}$), against TOMS 748 86/16/52, Brent 102/11/41, ITP at its recommended constants 132/3/19, the per-problem ITP oracle 121/4/29, and bisection 152/1/1. It wins twice as many problems as it loses against Chandrupatla and trails that method in total because its losses are the larger ones; the problems are not independent (§9), and taken by function family the comparison is 6/1/8 of 15 families, a tie. Dekker and Illinois solve 153 of 154 and are ranked after every method that solves all. The constant-free variant goes 79/3/72 against Chandrupatla ($p=0.63$, a tie in problems), 78/9/67 against TOMS 748 and 79/5/70 against Brent, and loses on the total to all three.")
R("| 1 | similarity, $1-\\sqrt{\\lvert z\\rvert}$, bracket scale, projection | no | **41/45** | 4516 | 0 |\n| 2 | Chandrupatla | no | 40/45 | 2441 | 0 |\n| 3 | ITP, per-problem oracle | yes | 40/45 | 2647 | 0 |\n| 4 | similarity, $e^{-\\lvert z\\rvert}$, bracket scale, both guards | no | 40/45 | 2736 | 0 |\n| 6 | ITP, recommended constants | yes | 40/45 | 2896 | 0 |\n| 10 | constant-free variant: earned projection | no | 40/45 | 3020 | 0 |\n| 16 | bisection | no | 40/45 | 3090 | 0 |\n| **45** | **base rule: tent, 3-point, projection ($c=2$)** | **no** | 40/45 | **3220** | 0 |\n| 159 | TOMS 748 | yes | 40/45 | 4000 | 15 |\n| 227 | Brent | yes | 38/45 | 4115 | 18 |\n| 228 | the same rule with no safeguard at all | no | 35/45 | 4104 | 10 |",
"| 1 | Chandrupatla | no | 45/45 | 1505 | 0 |\n| 2 | ITP, per-problem oracle | yes | 45/45 | 1675 | 0 |\n| 3 | similarity, $e^{-\\lvert z\\rvert}$, bracket scale, both guards | no | 45/45 | 1778 | 0 |\n| 5 | ITP, recommended constants | yes | 45/45 | 1946 | 0 |\n| 9 | constant-free variant: earned projection | no | 45/45 | 2073 | 0 |\n| 15 | bisection | no | 45/45 | 2136 | 0 |\n| **49** | **base rule: tent, 3-point, projection ($c=2$)** | **no** | 45/45 | **2357** | 0 |\n| 158 | TOMS 748 | yes | 45/45 | 3088 | 15 |\n| 227 | Brent | yes | 43/45 | 3238 | 18 |\n| 229 | the same rule with no safeguard at all | no | 39/45 | 3391 | 10 |")
R("The set's nominal winner is a similarity configuration that solves one problem more than anything else, 41 of 45, at a worse total; ranking by failures first puts it on top, and we report it as such rather than by the total that would flatter our proposal. Here Chandrupatla's method is genuinely the stronger: it beats the base rule 26 problems to 9 ($p=0.006$) and by 3220 against 2441 in total. The proposed rule beats Brent 30/4/4 and TOMS 748 31/1/8 — both of which exceed the $2\\times$ bound on 18 and 15 problems — and loses to ITP 17/0/23 and to the ITP oracle 16/0/24. The wide-bracket set is where the multiplier matters (Table 1a) and where the constant-free variant is the cheaper form, 3020 against 3220. Over both sets the base rule needs 6026 and the constant-free variant 6588, against 5228 for Chandrupatla, 5907 for the ITP oracle, 6820 for TOMS 748 and 7004 for Brent.",
"Here Chandrupatla's method is genuinely the stronger: it beats the base rule 29 problems to 11 ($p=0.006$) and by 1505 against 2357 in total. The base rule beats Brent 34/4/7 and TOMS 748 33/1/11 — which exceed $2\\times$ bisection, a bound they do not promise, on 18 and 15 problems — and loses to ITP 18/1/26 and to the ITP oracle 16/1/28. The wide-bracket set is where the multiplier matters (Table 1a) and where the constant-free variant is the cheaper form, 2073 against 2357. Over both sets the base rule needs 4991 and the constant-free variant 5450, against 4100 for Chandrupatla, 4743 for the ITP oracle, 5724 for TOMS 748 and 5945 for Brent.")
R("| APS, no safeguard | 153/154 | 2806 | 0 |\n| APS, projection — base rule ($2\\times$ bisection) | 153/154 | 2806 | 0 |\n| APS, earned projection — constant-free (bisection + 1 step) | 153/154 | 3568 | 0 |\n| Chandrupatla, no safeguard | 35/45 | 4104 | 10 |\n| Chandrupatla, projection — base rule | 40/45 | 3220 | 0 |\n| Chandrupatla, earned projection — constant-free | **40/45** | **3020** | **0** |",
"| APS, no safeguard | 154/154 | 2634 | 0 |\n| APS, projection — base rule ($2\\times$ bisection) | 154/154 | 2634 | 0 |\n| APS, earned projection — constant-free (bisection + 1 step) | 154/154 | 3377 | 0 |\n| Chandrupatla, no safeguard | 39/45 | 3391 | 10 |\n| Chandrupatla, projection — base rule | 45/45 | 2357 | 0 |\n| Chandrupatla, earned projection — constant-free | **45/45** | **2073** | **0** |")
R("The projection of the base rule never binds on the canonical set, so its totals are identical to the last evaluation; on the wide-bracket set it solves five more problems for 21% fewer evaluations. The earned projection promises twice as much — a worst case of bisection plus one step instead of twice bisection — and pays for it on the canonical set, 762 evaluations or 27%, while on the wide-bracket set it is the cheapest of the three. Both are the opposite of the usual trade on at least one set, and that is the point of projecting rather than replacing: the two safeguards that replace cost 7260 and 7239 on Alefeld–Potra–Shi, against 2806.",
"The projection of the base rule never binds on the canonical set, so its totals are identical to the last evaluation; on the wide-bracket set it solves six more problems for 30% fewer evaluations. The earned projection promises twice as much — a worst case of bisection plus one step instead of twice bisection — and pays for it on the canonical set, 743 evaluations or 28%, while on the wide-bracket set it is the cheapest of the three. Both are the opposite of the usual trade on at least one set, and that is the point of projecting rather than replacing: the two safeguards that replace cost 7068 and 7046 on Alefeld–Potra–Shi, against 2634.")
R("On the 199 problems as they stand, every $f$ being a formula of a few operations, the base rule is the **slowest** of the pure-Python methods compared, at 32.8 ms against 18.4 for Brent, 21.1 for ITP, 14.2 for Ridders and 22.9 for bisection — while using the fewest evaluations of all of them, 4991 against 5932, 5675, 6421 and 9474. Bisection, needing nearly twice the evaluations, finishes in two thirds of our time.\n\nThose evaluation counts are *raw*: they are what the timing loop actually spent, and a failed run contributes only the evaluations it made before the budget ran out. They are therefore not the totals of §5, where a failure is charged the full 200-evaluation budget so that no method can buy a low score by giving up — 4991 raw against 6026 charged for the base rule, 5932 against 6991 for Brent (our pure-Python implementation, which is what is timed; the tables use the library's `brentq`, 7004), 9474 against 10620 for bisection. Wall-clock time can only be compared against what was really executed, so the raw counts are the right companions to the milliseconds; every comparison in §5 uses the charged ones. Both are stated to avoid the appearance of two incompatible sets of numbers for the same methods.",
"On the 199 problems as they stand, every $f$ being a formula of a few operations, the base rule is the **slowest** of the pure-Python methods compared, at 32.8 ms against 18.4 for Brent, 21.1 for ITP, 14.2 for Ridders and 22.9 for bisection — while using the fewest evaluations of all of them, 4991 against 5932, 5675, 6421 and 9474. Bisection, needing nearly twice the evaluations, finishes in two thirds of our time. (These are the evaluations the timing loop actually spent; for the base rule and bisection, which solve every problem, they equal the totals of §5; Brent here is our pure-Python implementation, which is what is timed.)")
R("Corollaries 1–3 predict an ordering of the nine similarity functions and of the four scales. Table 4 reports it. The prediction holds without exception for every data-derived scale: the three similarities with $c=1$ occupy the top three places and the three with $c=0$ the bottom three. For the chosen scale the two groups are indistinguishable (16102 against 15345), which is consistent — with a chosen scale nothing converges well and the ordering carries no information.",
"Corollaries 1–3 predict that the similarities with $c=1$ come before those with $c=0$ under a data-derived scale; they say nothing about the order within a group, nor about the functions with unbounded slope. Table 4 reports it. For every data-derived scale the three similarities with $c=1$ occupy the top three places and the three with $c=0$ the bottom three. That $c=0$ is slow is the unsurprising half — a step proportional to $z^2$ is damped quadratically. For the chosen scale the two groups are indistinguishable (14983 against 14228), which is consistent — with a chosen scale nothing converges well and the ordering carries no information.")
R("| 3-point derived | **6893** | 22315 |\n| 2-point derived | 6981 | 22206 |\n| bracket | 10279 | 19127 |\n| start (chosen) | 16102 | 15345 |",
"| 3-point derived | **5764** | 21200 |\n| 2-point derived | 5854 | 21089 |\n| bracket | 9149 | 18015 |\n| start (chosen) | 14983 | 14228 |")
R("Ranked individually and best over scales, the similarities come out $1-|z|$ (6560), $e^{-|z|}$ (6895), $1/(1+|z|)$ (7118), $(1+|z|)^{-2}$ (9578), $1-\\sqrt{|z|}$ (10546), $1-|z|^{1/3}$ (12002), $e^{-z^2}$ (14307), $1/(1+z^2)$ (15102), $1/\\sqrt{1+z^2}$ (16394); the scales come out 3-point (6560), 2-point (6702), bracket (9107), start (14540). Both orderings are those the law predicts, and both were predicted before the grid was run.",
"Ranked individually and best over scales, the similarities come out $1-|z|$ (5422), $e^{-|z|}$ (5772), $1/(1+|z|)$ (5993), $(1+|z|)^{-2}$ (8455), $1-\\sqrt{|z|}$ (9411), $1-|z|^{1/3}$ (10874), $e^{-z^2}$ (13187), $1/(1+z^2)$ (13990), $1/\\sqrt{1+z^2}$ (15272); the scales come out 3-point (5422), 2-point (5564), bracket (7972), start (13423). The group order and the order of the scales are those the law predicts and were predicted before the grid was run; the order inside each group is measured, not predicted.")
# ---------------------------------------------------------------- section 6 (point 10)
R("but on Chandrupatla it removes 0.275 for the similarity rule against 0.058 for Brent and 0.068 for TOMS 748 — and that comparison already flatters them, since 69 and 141 of their probes respectively fall outside the proven bracket and are excluded, against none of ours. High-order interpolation is a wager that $f$ is locally polynomial. When the wager pays, order 1.84 or 2.65 wins the endgame; when it fails, the probes are wasted.",
"but on Chandrupatla it removes 0.275 for the similarity rule against 0.058 for Brent and 0.068 for TOMS 748. The bracket here is reconstructed from *every* sign the method has observed — the narrowest interval the evaluations prove, not the one the method keeps; Brent and TOMS 748 always probe inside their own bracket, but 69 and 141 of their probes fall outside this narrowest one and remove nothing from it, and those probes are left out of the median. High-order interpolation is a wager that $f$ is locally polynomial. When the wager pays, a high order wins the endgame; when it fails, the probe removes little.")
# ---------------------------------------------------------------- section 7: Table 5 and text
R("each parameter-free and each measured on the protocol of §4; every number below is re-checked against its own sweep file by `verify_article.py`, and every configuration in Table 5 keeps the $2\\lceil\\log_2(w_0/\\varepsilon_x)\\rceil+3$ guarantee (0 violations) and solves 193 of the 199 problems.",
"each parameter-free and each measured on the protocol of §4; every number below is re-checked against its own sweep file by `verify_article.py`, and every configuration in Table 5 keeps the $2\\lceil\\log_2(w_0/\\varepsilon_x)\\rceil+3$ guarantee (0 violations) and solves all 199 problems.")
R("| configuration (all with the guarantee, 193/199) | APS-154 | CHA-45 | both |\n|---|---|---|---|\n| base rule: tent, 3-point, projection $c=2$ (§3) | 2806 | 3220 | 6026 |\n| constant-free variant: earned projection (§3.1) | 3568 | 3020 | 6588 |\n| (1) trust before the step, projection | 2848 | 3114 | 5962 |\n| (1)+(2) points chosen by shape, *safe* | **2527** | 3126 | 5653 |\n| (1)+(3) far end by dissimilarity, projection | 2726 | **2799** | **5525** |\n| (1)+(2)+(3), *safe* | 2884 | 2871 | 5755 |\n| Chandrupatla | 2787 | 2441 | 5228 |\n| TOMS 748 | 2820 | 4000 | 6820 |\n| ITP, per-problem oracle | 3260 | 2647 | 5907 |",
"| configuration (all with the guarantee, 199/199) | APS-154 | CHA-45 | both |\n|---|---|---|---|\n| base rule: tent, 3-point, projection $c=2$ (§3) | 2634 | 2357 | 4991 |\n| constant-free variant: earned projection (§3.1) | 3377 | 2073 | 5450 |\n| (1) trust before the step, projection | 2663 | 2170 | 4833 |\n| (1)+(2) points chosen by shape, *safe* | **2337** | 2177 | 4514 |\n| (1)+(3) far end by dissimilarity, projection | 2539 | **1864** | **4403** |\n| (1)+(2)+(3), *safe* | 2695 | 1928 | 4623 |\n| Chandrupatla | 2595 | 1505 | 4100 |\n| TOMS 748 | 2636 | 3088 | 5724 |\n| ITP, per-problem oracle | 3068 | 1675 | 4743 |")
R("First, the canonical set improves from 2806 to **2527**, which is below every method measured, including Chandrupatla's 2787, with the worst-case guarantee intact. It hardly feels the declared multiplier of §3.1: 2527 for every multiplier from 1.5 to 4, 2541 at 1.25 (`measure_records_vs_multiplier.py`). Second, on the two sets together the 5525 of reading (3) passes ITP's oracle (5907) but not Chandrupatla (5228): the remaining gap is entirely on the wide-bracket families, where Chandrupatla needs 2441 against our 2695 (reading (3) under *safe*).",
"First, the canonical set improves from 2634 to **2337**, which is below every method measured, including Chandrupatla's 2595, with the worst-case guarantee intact. It hardly feels the declared multiplier of §3.1: 2337 for every multiplier from 1.5 to 4, 2351 at 1.25 (`measure_records_vs_multiplier.py`). Second, on the two sets together the 4403 of reading (3) passes ITP's oracle (4743) but not Chandrupatla (4100): the remaining gap is entirely on the wide-bracket families, where Chandrupatla needs 1505 against our 1752 (reading (3) under *safe*).")
R("The readings do not compose. Taken together, (2) and (3) give 2884 and 2871 — worse than either alone on the canonical set, and on the wide-bracket set worse than (3) alone.",
"The readings do not compose. Taken together, (2) and (3) give 2695 and 1928 — worse than either alone on the canonical set, and on the wide-bracket set worse than (3) alone.")
R("Under the constant-free earned projection the same readings gain far less. Reading (1) gives 3507 and 2997, (1)+(2) 3755 and 3021, (1)+(3) 3857 and 3002, all three together 4354 and 3037, against 3568 and 3020 for the constant-free variant itself:",
"Under the constant-free earned projection the same readings gain little or lose. Reading (1) gives 3316 and 2050, (1)+(2) 3564 and 2074, (1)+(3) 3666 and 2052, all three together 4163 and 2087, against 3377 and 2073 for the constant-free variant itself:")
R("Measured over the 252 cells of the grid, the correction behaves exactly as that reading predicts and not at all as a universal improvement. Paired inside each (function, safeguard) cell of the far-end reading it is cheaper in 29 of 60 cells — indistinguishable from a coin.",
"Measured over the grid, the correction behaves as that reading predicts and not as a universal improvement. Paired inside each (function, safeguard) cell of the far-end reading it is cheaper in 33 of 63 cells — indistinguishable from a coin.")
R("**Table 6.** The measured order in the step place, on the far-end reading with the ratio similarity $1/(1+|z|)$. Cheaper in 7 of 7 safeguards; in 29 of 60 cells over all nine functions.",
"**Table 6.** The measured order in the step place, on the far-end reading with the ratio similarity $1/(1+|z|)$. Cheaper in 7 of 7 safeguards; in 33 of 63 cells over all nine functions.")
R("| both | 4522 | **3675** | 3406 | **3241** |\n| bracket | 4606 | **3542** | 3602 | **3359** |\n| credit | 5190 | **4686** | 3013 | **2884** |\n| projection | 6932 | **6364** | 4789 | **4554** |\n| safe | 5987 | **5229** | 4134 | **3954** |\n| step | 6435 | **5551** | 4287 | **4068** |\n| none | 10676 | **10043** | 8265 | **7794** |",
"| both | 4331 | **3485** | 2469 | **2306** |\n| bracket | 4418 | **3352** | 2671 | **2428** |\n| credit | 4999 | **4495** | 2064 | **1933** |\n| projection | 6783 | **6176** | 4057 | **3751** |\n| safe | 5803 | **5040** | 3218 | **3032** |\n| step | 6251 | **5362** | 3371 | **3146** |\n| none | 10676 | **9855** | 8265 | **7424** |")
R("the best cell it reaches on the wide-bracket set is 2884, against 2695 for reading (3) above and 2441 for Chandrupatla. In the *slope* reading of §3 the same exponent is harmful, $2806\\to2854$,",
"the best cell it reaches on the wide-bracket set is 1933, against 1752 for reading (3) above and 1505 for Chandrupatla. In the *slope* reading of §3 the same exponent is harmful, $2634\\to2703$,")
R("In total, no. With Chandrupatla's band in our step, the wide-bracket set costs 3059 under the projection and 2892 under *credit*, against his 2441, while the canonical set rises from 2806 to 5432.",
"In total, no. With Chandrupatla's band in our step, the wide-bracket set costs 2101 under the projection and 1942 under *credit*, against that method's own 1505, while the canonical set rises from 2634 to 5242.")
R("Our own readings do not close it either (best 2897 on the wide-bracket set), but \"defect\" sets a new best on the canonical set: **2523** at 153/154 under the projection of the base rule, below the 2527 of reading (2) and below every method measured, with the guarantee intact — and, unlike 2527, the same for every multiplier from 1.25 to 4. Under the earned projection it gives 3545 and 2949 (6494 against 6588), the best of the readings of this section without a constant; the flat regime of §8 does better still. It refuses only 6.6% of steps, the fewest of the three. Over both sets it costs 5733 against the 5525 of reading (3), because it gives back on the wide brackets (3210) what it gains on the canonical problems — so it is a second point on the same trade, not a replacement.",
"Our own readings do not close it either (best 1941 on the wide-bracket set), but \"defect\" gives the second-best canonical total: **2351** under the projection of the base rule, next to the 2337 of reading (2) and below every method measured, with the guarantee intact, and between 2343 and 2353 for every multiplier from 1.25 to 4. Under the earned projection it gives 3354 and 2002 (5356 against 5450), the best of the readings of this section without a constant; the flat regime of §8 does better still. It refuses only 6.6% of steps, the fewest of the three. Over both sets it costs 4697 against the 4403 of reading (3), because it gives back on the wide brackets (2346) what it gains on the canonical problems — so it is a second point on the same trade, not a replacement.")
# ---------------------------------------------------------------- 7.3: the artefact, and why one criterion
R("### 7.3 Six problems of the two sets are scored unsolved for every method",
"### 7.3 Why the criterion is a sign change: six problems the published root cannot score")
R("The consequence is arithmetic. Each such problem charges the full budget of 200 evaluations to every method: about 1150 evaluations of every reported two-set total — ours, Chandrupatla's, TOMS 748's, ITP's, Brent's, bisection's — are this artefact, and the \"153 of 154\" and \"40 of 45\" that every method reports are statements about the scoring rather than about the methods. Re-scored with the criterion \"a root is a root\" ($|x-\\text{root}|\\le10^{-6}$ *or* $f(x)=0$), the same runs solve 199 of 199 for every method except Brent's 197, and the totals fall as follows.",
"The consequence is arithmetic. Each such problem charges the full budget of 200 evaluations to every method, so about 1150 evaluations of every two-set total under the harness — ours and every competitor's — are this artefact, and the \"153 of 154\" and \"40 of 45\" that every method reports under the harness are statements about the scoring rather than about the methods. This is why every number in this paper uses the bracketing criterion of §4, a sign change within $10^{-6}$ of the returned point or $f=0$ there: under it Chandrupatla, TOMS 748, ITP, bisection and every configuration of Table 5 solve all 199, Brent 197, Dekker and Illinois 178 and 177.")
R("**Table 7.** The same runs under the harness criterion and under \"a root is a root\". The ranking is unchanged; the magnitudes are not, and neither is the size of the remaining gap on the wide-bracket set: 235 evaluations, or 16%, not 10%.\n\n| method | APS as scored | APS re-scored | CHA as scored | CHA re-scored |\n|---|---|---|---|---|\n| ours, (1)+(2) points by shape | **2527** | **2337** | 3108 | 2159 |\n| ours, base rule (projection) | 2806 | 2634 | 3220 | 2357 |\n| Chandrupatla | 2787 | 2595 | **2441** | **1505** |\n| TOMS 748 | 2820 | 2636 | 4000 | 3088 |\n| Brent | 2889 | 2707 | 4115 | 3238 |\n| ITP | 3957 | 3767 | 2896 | 1907 |\n| bisection | 7530 | 7338 | 3090 | 2136 |\n",
"")
# ---------------------------------------------------------------- 7.4 (internal inconsistency)
R("The endgame is not the cause — our observed order on those very problems is the higher one (3.63 against 2.02 on the $2\\times10^4$-wide bracket). The cause is the rate of progress far from the root:",
"The endgame is not the cause; the cost is incurred far from the root:")
R("It is not the guarantee that caps us. With the safeguard removed entirely the same problems cost 46, 57, 61 and 68 against bisection's 57, 77, 45 and 45 — better on the wide brackets, *worse than bisection* on `fun3.1` and `fun5.1` — and still far from Chandrupatla's 24 and 44.",
"It is not the guarantee that caps us. (The five costs above are under the *safe* safeguard; under the projection of the base rule they are 7, 12, 30, 46, 57.) With the safeguard removed entirely the two widest brackets, `fun1.4` and `fun1.5`, cost 46 and 57: better than bisection's 57 and 77, still far from Chandrupatla's 24 and 44. Unguarded, the rule is worse than bisection elsewhere — 61 and 68 against 45 on the flat problems `fun3.1` and `fun5.1` — which is what the guarantee is for.")
R("That mechanism is right for `fun1` and *wrong as a statement about the whole gap*. Replaying our own trajectories on the 33 problems where we lose, and placing both models on the *same* evaluations — one extra evaluation each, from the same state — splits the 256 evaluations of the gap in two. On `fun1` (58 of them, about a quarter)",
"That mechanism is right for `fun1` and *wrong as a statement about the whole gap*. Replaying our own trajectories on the 35 problems where we lose, and placing both models on the *same* evaluations — one extra evaluation each, from the same state — splits the 262 evaluations of the gap in two. On `fun1` (58 of them, about a fifth)")
R("(verified on all 428 non-degenerate states; in the other three the negative weight underflowed to $-0$).",
"(verified on all 431 non-degenerate states; in the other three the negative weight underflowed to $-0$).")
R("But 172 of the 256 — two thirds — sit on `fun3`–`fun6`,",
"But 172 of the 262 — two thirds — sit on `fun3`–`fun6`,")
R("bracket progress with \"the step has not moved the bracket yet\" (4449 on the canonical set, §10), and the local order with nothing at all — $m\\ge2$ is exactly the condition under which a tangent step loses to a halving, since it lands at $e(1-1/m)$, and it is clean (0.2% of canonical states) but blind:",
"bracket progress with \"the step has not moved the bracket yet\" (4258 on the canonical set, §10), and the local order with nothing at all — $m\\ge2$ is exactly the condition under which a tangent step loses to a halving, since it lands at $e(1-1/m)$, and it is clean (0.3% of canonical states) but blind:")
R("On the re-scored wide-bracket set of Table 7 our shape reading (2159) is *worse* than bisection (2136); only the dissimilarity reading (1740) is clearly ahead,",
"On the wide-bracket set our shape reading (2177) is *worse* than bisection (2136); only the dissimilarity reading (1752 under *safe*) is clearly ahead,")
R("Every statement in §§7.3–7.4 is reproduced by `diag_rescore_cha.py`, `diag_rescore_aps.py`, `diag_fun7_root.py`, `diag_cha_gap.py`,",
"Every statement in §§7.3–7.4 is reproduced by `diag_fun7_root.py`, `diag_cha_gap.py`, `diag_who_caps_us.py`,")
# ---------------------------------------------------------------- section 8
R("Replacing the one flagged step by a halving costs the canonical set 2806 → 3029,",
"Replacing the one flagged step by a halving costs the canonical set 2634 → 2839,")
R("A sticky halving without this exit cost the canonical set 6897; with it, 3125 — the exit is what makes a false entry cheap.",
"A sticky halving without this exit cost the canonical set 6707; with it, 2935 — the exit is what makes a false entry cheap.")
R("and removing it alone takes the canonical set from 2806 to 2564.",
"and removing it alone takes the canonical set from 2634 to 2392.")
R("**Table 8.** A′ on the protocol of §4 (published roots, failures charged 200). Per problem against each rival: wins/ties/losses, exact two-sided sign test.\n\n| | APS-154 | CHA-45 | both | vs A′ per problem, APS | vs A′ per problem, CHA |\n|---|---|---|---|---|---|\n| **A′ (proposed)** | **2438** | **2005** | **4443** | — | — |\n| A′, earned budget (no free constant) | 3608 | 2807 | 6415 | | |\n| base rule (§3) | 2806 | 3220 | 6026 | | |\n| Chandrupatla | 2787 | 2441 | 5228 | A′ 103/20/30, $p=1.5\\cdot10^{-10}$ | A′ 29/4/7, $p=3\\cdot10^{-4}$ |\n| TOMS 748 | 2820 | 4000 | 6820 | A′ 127/6/20 | A′ 38/2/0 |\n| Brent | 2889 | 4115 | 7004 | A′ 118/17/18 | A′ 33/3/2 |\n| ITP, per-problem oracle | 3260 | 2647 | 5907 | A′ 126/7/20 | A′ 35/1/4 |\n| ModAB [10, 20] | 2914 | 2436 | 5350 | A′ 118/11/25 | A′ 32/9/4 |\n\nA′ is 12.5% below Chandrupatla on the canonical set and 17.9% below on the wide-bracket set, and beats every rival problem by problem on both. On the wide-bracket families it is ahead on seven of nine, level on `fun7` (the scoring artefact of §7.3) and behind on `fun9`, 65 against 55. The earned-budget form keeps its constant-free guarantee of bisection plus one step and pays for it as in §3.1.",
"**Table 8.** A′ on the two sets of §4 (failures charged 200). A′'s wins/ties/losses against each rival over all problems of the set, exact two-sided sign test.\n\n| | APS-154 | CHA-45 | both | A′ per problem, APS | A′ per problem, CHA |\n|---|---|---|---|---|---|\n| **A′ (proposed)** | **2259** | **1074** | **3333** | — | — |\n| A′, earned budget (no free constant) | 3417 | 1852 | 5269 | | |\n| base rule (§3) | 2634 | 2357 | 4991 | | |\n| Chandrupatla | 2595 | 1505 | 4100 | 103/20/31, $p=3\\cdot10^{-10}$ | 31/4/10, $p=0.001$ |\n| TOMS 748 | 2636 | 3088 | 5724 | 127/6/21 | 42/2/1 |\n| Brent | 2707 | 3238 | 5945 | 118/17/19 | 39/3/3 |\n| ITP, per-problem oracle | 3068 | 1675 | 4743 | 126/7/21 | 35/1/9 |\n| ModAB [10, 20] | 2726 | 1681 | 4407 | 118/10/26 | 34/4/7 |\n\nA′ is 12.9% below Chandrupatla on the canonical set and 28.6% below on the wide-bracket set, and wins more problems than it loses against every rival on both. By function family, the unit in which these problems are independent (§9), it is ahead of Chandrupatla on 8 of the 15 canonical families (6 behind, one level) and on 7 of the 9 wide-bracket families — too few families for either count to be significant ($p=0.79$, $0.18$). The two it is behind on are `fun7`, 69 against 64, and `fun9`, 65 against 55. The earned-budget form keeps its constant-free guarantee of bisection plus one step and pays for it as in §3.1.")
R("**Table 9a.** The similarity in the step of A′: the same method with each of the nine similarity functions of §5.3 in place of the tent, everything else unchanged. Totals on the protocol of §4 and over the six corpora of §9 (uniform criterion); the guarantee holds with every function.\n\n| $S$ in the step | APS + CHA | six corpora (855) |\n|---|---|---|\n| **tent $1-|z|$ (A′)** | **4443** | **13032** |\n| $e^{-|z|}$ | 4988 | 14142 |\n| $1/(1+|z|)$ | 5486 | 14843 |\n| $(1+|z|)^{-2}$ | 8360 | 28500 |\n| $1-\\sqrt{|z|}$ | 12718 | 45552 |\n| $1-|z|^{1/3}$ | 17207 | 63031 |\n| $e^{-z^2}$ | 18410 | 67701 |\n| $1/\\sqrt{1+z^2}$ | 18412 | 67854 |\n| $1/(1+z^2)$ | 18422 | 67394 |\n\nThe similarity in the step earns its place in the proposed method as it did in the base rule: the nearest other function costs 12% more on the canonical protocol and 9% more over the six corpora, the functions that approach 1 quadratically cost four to five times more, and the ranking is the one the contraction law of §2.2 predicts, the three functions with a linear approach first and the three with a quadratic approach last.",
"**Table 9a.** The similarity in the step of A′: the same method with each of the nine similarity functions of §5.3 in place of the tent, everything else unchanged. Totals on the two sets of §4 and over the six corpora of §9; the guarantee holds with every function.\n\n| $S$ in the step | APS + CHA | six corpora (855) |\n|---|---|---|\n| **tent $1-|z|$ (A′)** | **3333** | **13032** |\n| $e^{-|z|}$ | 3965 | 14142 |\n| $1/(1+|z|)$ | 4424 | 14843 |\n| $(1+|z|)^{-2}$ | 7249 | 28500 |\n| $1-\\sqrt{|z|}$ | 11613 | 45552 |\n| $1-|z|^{1/3}$ | 16094 | 63031 |\n| $e^{-z^2}$ | 17429 | 67701 |\n| $1/(1+z^2)$ | 17452 | 67394 |\n| $1/\\sqrt{1+z^2}$ | 17487 | 67854 |\n\nThe nearest other function costs 19% more on the two sets and 9% more over the six corpora, and the functions that approach 1 quadratically cost five times more; the three functions with a linear approach come first and the three with a quadratic approach last, as the contraction law of §2.2 predicts. What this measures should be said plainly: with the tent the step is the undamped Newton step clipped to the bracket, and the other functions damp it, so the table shows that the undamped step is the better one — expected, and evidence for the choice of $S$ within the rule rather than for the similarity framing as such.")
# ---------------------------------------------------------------- section 9
R("Every decision above was taken on the two sets of §4. Pre-registration protects each decision but not the chain: the final configuration was selected on the same 199 problems.",
"Every decision above was taken on the two sets of §4. Pre-registration protects each decision but not the chain: the final configuration — a decision layer of about ten discrete rules, chosen among the many candidates listed in §10 — was selected on the same 199 problems.")
R("4. **Corpus 4** — 240 problems in six new families (seed 20260922): random polynomials with a simple root, polynomials with a multiple root, fractional powers $|x-r|^p$ with $p\\sim U(0.15,0.95)$, sums of exponentials and sines, compositions $\\tanh$, $\\arctan$, $\\log(1+q^2)$ of a cubic, and functions odd about the root. The code of A′ was committed *before* this corpus was run, and nothing was changed after.",
"4. **Corpus 4** — 240 problems in six new families (seed 20260922): random polynomials with a simple root, polynomials with a multiple root, fractional powers $|x-r|^p$ with $p\\sim U(0.15,0.95)$, sums of exponentials and sines, compositions $\\tanh$, $\\arctan$, $\\log(1+q^2)$ of a cubic, and functions odd about the root. The code of A′ was committed *before* this corpus was run, and nothing was changed after. The families were chosen by the author, who knew by then where the method is strong: two of the six (multiple roots, fractional powers) are the regime §8 was built for.\n\nA root must carry a sign change to be bracketed, so the multiple roots in these corpora have odd multiplicity (3, 5, 7, 9 in corpus 4) or the form $\\operatorname{sign}(x-r)|x-r|^p$ (corpora 1 and 4).")
R("| corpus | A′ | Chandrupatla | ModAB | Brent | TOMS 748 |\n|----------------------|------------|--------------|------------|------------|------------|\n| APS (154) | **2259** (0) | 2595 (0) | 2726 (0) | 2707 (0) | 2636 (0) |\n| Chandrupatla (45) | **1074** (0) | 1505 (0) | 1681 (0) | 3238 (18) | 3088 (15) |\n| new corpus 1 (206) | **3290** (0) | 3716 (0) | 3809 (1) | 6395 (38) | 5746 (22) |\n| Roots.jl (78) | **1371** (0) | 1566 (0) | 1446 (0) | 2455 (11) | 2339 (9) |\n| applied + GSL (132) | 1382 (0) | 1382 (0) | 1460 (0) | 1503 (1) | 1756 (1) |\n| **corpus 4 (240), the one test** | **3656** (0) | 5717 (0) | 5535 (8) | 8267 (50) | 8084 (37) |\n| all 855 | **13032** | 16481 | 16657 | 24565 | 23649 |",
"| corpus | A′ | Chandrupatla | ModAB | ITP | ITP oracle | Brent | TOMS 748 |\n|----------------------|------------|--------------|------------|------------|------------|------------|------------|\n| APS (154) | **2259** (0) | 2595 (0) | 2726 (0) | 3767 (0) | 3068 (0) | 2707 (0) | 2636 (0) |\n| Chandrupatla (45) | **1074** (0) | 1505 (0) | 1681 (0) | 1946 (0) | 1675 (0) | 3238 (18) | 3088 (15) |\n| new corpus 1 (206) | **3290** (0) | 3716 (0) | 3809 (1) | 5674 (0) | 4707 (0) | 6395 (38) | 5746 (22) |\n| Roots.jl (78) | **1371** (0) | 1566 (0) | 1446 (0) | 2161 (0) | 1629 (0) | 2455 (11) | 2339 (9) |\n| applied + GSL (132) | 1382 (0) | 1382 (0) | 1460 (0) | 3245 (0) | 2386 (0) | 1503 (1) | 1756 (1) |\n| **corpus 4 (240), the one test** | **3656** (0) | 5717 (0) | 5535 (8) | 5721 (0) | 4832 (0) | 8267 (50) | 8084 (37) |\n| all 855 | **13032** | 16481 | 16657 | 22514 | 18297 | 24565 | 23649 |")
R("Only the last line of corpora is evidence for A′ in the strict sense; the first five were seen while it was developed and are reported as a description.",
"Only the last line of corpora is evidence for A′ in the strict sense; the first five were seen while it was developed and are reported as a description. ITP, at its recommended constants and as the per-problem oracle, keeps its own bound of bisection plus $n_0$ everywhere and is behind A′ on every corpus.\n\n**Independence.** A sign test counts problems as independent draws, and not all of them are. In the two canonical sets one function appears with several brackets or parameters, so the independent unit is the function family (15 in APS, 9 in CHA); at that level the counts of Table 8 are not significant, because there are too few families. In corpora 1 and 4 every problem is drawn independently from its family's generator, so the per-problem test is valid — for the population those generators define, which the author chose (above).")
R("**What the evidence supports, and what it does not.** Against Brent and TOMS 748 A′ is ahead on every corpus, by 8% to 67% in total, and it keeps its bound on all 855 problems, which Brent breaks on 118 and TOMS 748 on 84.",
"**What the evidence supports, and what it does not.** Against Brent and TOMS 748 A′ is ahead on every corpus, by 8% to 67% in total, and it stays within its own bound of twice bisection on all 855 problems, a bound that Brent exceeds on 118 and TOMS 748 on 84 — neither promises it.")
R("ModAB breaks the bound on 9 problems.",
"ModAB exceeds that bound, which it does not promise either, on 9 problems.")
# ---------------------------------------------------------------- section 10
R("2. **Every safeguard that replaces the step destroys the order.** Bracket-based and step-based replacement both drop the three-point rule from order 1.94 to 1.00 and cost 7260 and 7239 evaluations on Alefeld–Potra–Shi.",
"2. **Every safeguard that replaces the step destroys the order.** Bracket-based and step-based replacement both make the three-point rule converge linearly and cost 7068 and 7046 evaluations on Alefeld–Potra–Shi.")
R("3. **Zero slack in the projection is not the degenerate case it was said to be.** An earlier version reported that a worst case of exactly bisection leaves the projection no freedom and makes the guard behave as bisection. Measured (Table 1a), multiplier 1 costs 4817 and 2997, against bisection's 7530 and 3090 — and on the wide-bracket set it beats the multiplier of 2. It remains the most expensive multiplier on the canonical set, which is all that survives of the claim.",
"3. **Zero slack in the projection is not a degenerate case.** A worst case of exactly bisection might be expected to leave the projection no freedom and make the guard behave as bisection. Measured (Table 1a), multiplier 1 costs 4625 and 2039, against bisection's 7338 and 2136 — and on the wide-bracket set it beats the multiplier of 2. It is the most expensive multiplier on the canonical set.")
R("But the same similarity over the whole Chandrupatla set costs 4109 against 3220, so a switch chosen per benchmark is worse than no switch at all: 6915 against 6026 over both sets.",
"But the same similarity over the whole Chandrupatla set costs 3204 against 2357, so a switch chosen per benchmark is worse than no switch at all: 5838 against 4991 over both sets.")
R("It preserves the order (2.001) and improves the eight standard problems (82 against 84) — and loses on the full benchmark, 6304 against 6026.",
"It improves the eight standard problems (82 against 84) — and loses on the full benchmark, 5336 against 4991.")
R("A cruder variant, correcting by the fraction of its own promise the previous step kept, fails everything: the order collapses to 0.904 and the standard problems double to 161.",
"A cruder variant, correcting by the fraction of its own promise the previous step kept, fails everything: the convergence becomes sublinear and the standard problems double to 161.")
R("6. **One problem is scored unsolved for every method**, `aps.13.00`, $f(x)=x e^{-1/x^2}$, all of whose derivatives vanish at the root and which underflows to exactly zero throughout $|x|<0.086$. Every method returns a point where $f(x)=0$ exactly — a genuine root — which the harness scores as a failure because it lies more than $10^{-6}$ from the declared root. It is a property of the scoring, not a failure of the methods; §7.3 finds five more such problems in the wide-bracket set.",
"6. **The harness scores one canonical problem unsolved for every method**, `aps.13.00`, $f(x)=x e^{-1/x^2}$, all of whose derivatives vanish at the root and which underflows to exactly zero throughout $|x|<0.086$. Every method returns a point where $f(x)=0$ exactly — a genuine root — which the harness scores as a failure because it lies more than $10^{-6}$ from the declared root. With the five `fun7` problems of §7.3 it is why this paper scores by a sign change.")
R("costs 4449 on the canonical set against 2527 — a difference of 1922 evaluations for one choice of criterion. A secant step routinely collapses the error while barely moving the proven bracket, so bracket progress rejects steps that were excellent; this is the same mechanism that makes the bracket guard of §3.1 cost 7260.",
"costs 4258 on the canonical set against 2337 — a difference of 1921 evaluations for one choice of criterion. A secant step routinely collapses the error while barely moving the proven bracket, so bracket progress rejects steps that were excellent; this is the same mechanism that makes the bracket guard of §3.1 cost 7068.")
R("and on eight hand-picked wide problems it improves 403 evaluations to 390. Over the whole grid it is worse on both sets: 3288 on the canonical set against 2726, and 3111 on the wide-bracket set against 2695. Its apparent extra solves (194 instead of 193) are two `fun7` problems where it lands inside the flat zero region close enough to satisfy the harness — the artefact of §7.3, not a capability.",
"and on eight hand-picked wide problems it improves 403 evaluations to 390. Over the whole grid it is worse on both sets: its best cell is 3101 on the canonical set against 2539 for the best uncapped cell of the same grid, and 1766 on the wide-bracket set against 1752.")
R("Unguarded, the correction takes the far-end reading from 127/154 and 10676 to 128/154 and 10043 — one problem and six per cent — where Illinois, at the price of one constant (halve the stale ordinate), reaches 153/154 and 7045.",
"Unguarded, the correction takes the far-end reading from 127/154 and 10676 to 129/154 and 9855 — two problems and eight per cent — where Illinois, at the price of one constant (halve the stale ordinate), reaches 153/154 and 7045.")
R("for the same similarity, scale and safeguard ($(1+|z|)^{-2}$, two-point, *safe*) the wide-bracket set improves from 3695 to 3541 — but the canonical set gets worse, 5822 to 6940, against the 2806 of the base rule. An earlier version compared the 3541 with 4516, which is the total of a different configuration.",
"for the same similarity, scale and safeguard ($(1+|z|)^{-2}$, two-point, *safe*) the wide-bracket set improves from 2759 to 2598 — but the canonical set gets worse, 5635 to 6749, against the 2634 of the base rule.")
R("but a halving in place of each flagged step takes the canonical set from 2806 to 3029 and the wide-bracket set only from 3220 to 3198: a simple root far from convergence breaks its promises too. Requiring the promise to fail twice in a row keeps the canonical set (2803) but fires one step late, before the crossing, and replaces the most useful step of the cycle (wide brackets 3341); requiring a creep in one direction as well gives 2878 and 3354.",
"but a halving in place of each flagged step takes the canonical set from 2634 to 2839 and the wide-bracket set only from 2357 to 2243: a simple root far from convergence breaks its promises too. Requiring the promise to fail twice in a row keeps the canonical set (2613) but fires one step late, before the crossing, and replaces the most useful step of the cycle (wide brackets 2388); requiring a creep in one direction as well gives 2688 and 2399.")
R("Without an exit the flat families fall to 1057 — pure bisection's level — and the canonical set rises to 6897, because a false entry now lasts to the end of the run. Splitting at the order read from the failed promise, $(1-1/m)^m=r$, changes nothing: that order is $m=\\infty$ in 163 of 174 entries (6781).",
"Without an exit the flat families fall to 1057 — pure bisection's level — and the canonical set rises to 6707, because a false entry now lasts to the end of the run. Splitting at the order read from the failed promise, $(1-1/m)^m=r$, changes nothing: that order is $m=\\infty$ in 163 of 174 entries (6591).")
R("also at *entry* gives 3009 and 2486 against 3125 and 2503 for the exit alone:",
"also at *entry* gives 2820 and 1532 against 2935 and 1546 for the exit alone:")
R("Combined with the regime it was the best configuration on the two development sets (§7.2's canonical record 2523 with the flat families of §8),",
"Combined with the regime it was the best configuration on the two development sets (§7.2's defect reading with the flat families of §8),")
R("Remembering the analogy for the run was rejected by its own pre-registration (canonical set 2814 against 2806 without the regime), and with the split of §8.3 it is the better form (with the step pattern, wide brackets 2117 against 2221 for the analogy read in one state).",
"Remembering the analogy for the run was rejected by its own pre-registration, under the harness scoring of the time (canonical set 2814 against 2806 without the regime; under the sign-change criterion the two are level, 2633 against 2634), and with the split of §8.3 it is the better form (with the step pattern, wide brackets 1250 against 1388 for the analogy read in one state).")
# ---------------------------------------------------------------- conclusion
R("The base rule has one declared constant and carries a worst case of twice bisection plus one step. On the canonical Alefeld–Potra–Shi set it is level with TOMS 748 and with Chandrupatla's method in total and ahead of both problem by problem; on the wide-bracket set Chandrupatla is genuinely stronger (2441 against 3220).",
"The base rule has one declared numerical constant, converges with Muller's order 1.839 and carries a worst case of twice bisection plus one step. On the canonical Alefeld–Potra–Shi set it is level with TOMS 748 in total and 1.5% behind Chandrupatla's method, while winning more problems than it loses against both; on the wide-bracket set Chandrupatla is genuinely stronger (1505 against 2357).")
R("The claim the measurements support is a lead over Brent, TOMS 748 and ModAB everywhere, with the guarantee they do not keep,",
"The claim the measurements support is a lead over Brent, TOMS 748, ITP and ModAB everywhere, within a bound of twice bisection that Brent, TOMS 748 and ModAB do not promise and exceed,")
R("It is not in the shape of $S$ — nine shapes were tried and their ranking is dictated by a single number, the slope of $1-S$ at the origin.",
"It is not in the shape of $S$ — nine shapes were tried and which group of them comes first is dictated by a single number, the slope of $1-S$ at the origin.")
def main():
src = open(PATH, encoding="utf8").read()
bad = [old[:90] for old, _ in REPL if src.count(old) != 1]
if bad:
for b in bad:
print("ANCHOR NOT FOUND EXACTLY ONCE:", b)
raise SystemExit(f"{len(bad)} anchors failed; nothing written")
for old, new in REPL:
src = src.replace(old, new)
open(PATH, "w", encoding="utf8").write(src)
print(f"applied {len(REPL)} replacements")
if __name__ == "__main__":
main()