Files
sim-numerics/apply_article_trim.py
T
vvsandClaude Opus 5 0a62f7babb Revision step 3: restructured and shortened paper, full listing of A', code availability.
Title: 'Root Finding by Similarity and Analogy: A Bracketing Method with a Data-Selected Decision Layer'. Abstract 246 words. Main text 10.4k words (was 17.4k): search reports moved to Appendices A (old 6-7), B (wall-clock), C (negative results); revision history removed; pronouns for Chandrupatla's method fixed; tables numbered in order. New: Algorithm 2 (complete A'), the decision layer counted honestly in 6.5, Code and data availability, Appendix D (30 pre-registrations against the first commit of their own results, read from git by check_prereg_order.py: 25 before, 4 same commit, 1 decided on the smoke; A' frozen at 8027d7f between corpus 4's definition 657df10 and its results 6d2531e). Literature: Bus & Dekker 1975, Fernandez-Diaz & Menendez-Perez 2023 (two dimensionless parameters; SFRFm on sign(f)|f|^(1/m) with known multiplicity - the nearest precursor of the split), Cordero-Neta-Torregrosa 2021; Illinois and Ridders cited. verify_article: explicit check that every head-to-head row sums to its set. check_new_numbers.py: no number new to the text except headings, references, hashes. Server: verify 527 OK / 0 BAD, regression x2 1232 passed, PDF 30 pages, 0 errors, 0 undefined, 0 overfull.

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

102 lines
32 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 3b: the main text shortened. Each paragraph below is replaced by a
shorter one that keeps its claim and every number it keeps verbatim (verify_article.py checks the
data; nothing new is claimed). Exact anchors, each found exactly once, or nothing is written.
python -u apply_article_trim.py
"""
from __future__ import annotations
PATH = "article/sim_numerics.md"
R = []
def E(old, new):
R.append((old, new))
E("That is the false-position formula. Two things must be said about how far it reaches, because the obvious generalisation is false.\n\nIt is specific to that similarity. On $f=x^2-2$ over $[1,4]$, where false position gives 1.200000, the same construction gives 1.206812 for $e^{-|z|}$, 1.015228 for $1/(1+z^2)$, 1.007624 for $1/\\sqrt{1+z^2}$ and 1.214286 for the truncated linear form: one of five reproduces it. 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.",
"That is the false-position formula, and it is specific to that similarity: on $f=x^2-2$ over $[1,4]$, where false position gives 1.200000, $e^{-|z|}$ gives 1.206812, $1/(1+z^2)$ 1.015228, $1/\\sqrt{1+z^2}$ 1.007624 and the truncated linear form 1.214286. Bracket-scaled similarity configurations take third, fourth and sixth place on Chandrupatla's set (Table 3), where false position solves 6 of 45.")
E("Together the two say where the boundary of novelty runs, and it is not where one would guess: it runs through the words *most recent* in the definition of $\\hat f'$ in §3. A divided difference over the bracket ends is three centuries old; the same difference over the most recent iterates is the secant.",
"Together the two say that the boundary of novelty runs through the words *most recent* in the definition of $\\hat f'$ in §3: a divided difference over the bracket ends is false position, the same difference over the most recent iterates is the secant.")
E("The last row is not a slow rate but an immediate failure, and it matters because that similarity is the one this paper goes on to propose. At $x_0=0$ the residual is $z=-1$, so $S=\\max(0,1-1)=0$, the step is the whole bracket, the iterate lands exactly on $x_\\mathrm{far}$ and never leaves: the error is 0.5858 after one step and after two hundred. **The failure is a property of the chosen scale, not of the similarity.** Under the derived scale of §3 the residual $|f|/\\sigma$ stays below 1 — on this problem the clip does not engage on a single one of the seven steps the method takes — the truncation never fires, and the same function is the best of the nine (Table 4). This is the paper's own thesis, that the content sits in the scale and not in the shape of $S$, showing up as a discontinuity in the behaviour of one function.",
"The last row fails at once, and it matters because that similarity is the one this paper proposes: at $x_0=0$, $z=-1$, so $S=0$, the step is the whole bracket and the iterate stays at $x_\\mathrm{far}$ (error 0.5858 after one step and after two hundred). The failure belongs to the chosen scale, not to the similarity: under the derived scale of §3 the clip never engages on this problem, and the same function is the best of the nine (Table 4).")
E("Corollaries 1–3 fix every choice in the method before any benchmark is consulted. We record them here as a prediction, and Section 5.2 tests it against the full grid. One number in the safeguard is not fixed by them, and §3.1 declares it as the method's one free constant.",
"Corollaries 1–3 fix every choice before any benchmark is consulted; Section 5.2 tests the prediction against the full grid. One number in the safeguard is not fixed by them, and §3.1 declares it.")
E(" It is not the ratio form $1/(1+|z|)$, which is a separate row of every table here; the two are distinguished throughout because Proposition 1 applies to the ratio form and Table 1's last row to the tent.",
" It is not the ratio form $1/(1+|z|)$ of Proposition 1.")
E("a Newton step with a three-point divided-difference derivative, clipped to the bracket and then projected as in §3.1. That the tent turns the similarity step into Newton's is a property of the similarity chosen, not a sign that the similarity has dropped out: which $S$ stands in the step decides the step, and it is measured, not assumed — Table 4 ranks the nine functions over the whole grid, the readings of §A.2 pay most with the tent in the step and some of them lose with other functions (§A.2), and in the proposed method replacing the tent by any other function costs 19% to 425% (Table 7).\n\nWe state the reduction ourselves rather than leave it to be discovered, because it locates the contribution precisely. The base rule is not a new family of methods. It is (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; (ii) a safeguard of ITP's projection type with ITP's truncation stage, and hence all three of its constants, removed; (iii) the negative results of Appendix C; (iv) the measurements. We call it the **base rule**; the method this paper proposes builds on it in Section 6.",
"a Newton step with a three-point divided-difference derivative, clipped to the bracket and then projected as in §3.1. That the tent turns the similarity step into Newton's is a property of the chosen similarity, and which $S$ stands in the step is measured rather than assumed: in the proposed method, replacing the tent by any other function costs 19% to 425% (Table 7). The base rule is therefore not a new family of methods; what is ours is a derivation that fixes every choice before any benchmark is consulted, and a safeguard of ITP's projection type with ITP's truncation stage — and all three of its constants — removed. The proposed method builds on it in Section 6.")
E("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$. The multiplicative family has no member that the bound singles out, so its multiplier is a genuinely free constant.",
"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). On the wide-bracket set the cost rises monotonically with $c$ from 1.25 on, and 2 is not the best value; zero slack ($c=1$) is not degenerate either (4625 and 2039, against bisection's 7338 and 2136). No member of the family is singled out by the bound: the multiplier is a free constant.")
E("A looser promise buys evaluations, as it must; within one promise the cheapest endowment is determined. The constant-free variant is therefore the earned projection with $C_0=1$, whose guarantee — $\\lceil\\log_2(w_0/\\varepsilon_x)\\rceil+4$ evaluations, bisection plus one step with one more for the floating-point boundary — is verified on all 199 problems.\n\nWe 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 numerical constant and the better canonical result, or none, a tighter bound and the better wide-bracket result. The value 2 was fixed before any benchmark was consulted.",
"Within one promise the cheapest endowment is determined, so the constant-free variant is the earned projection with $C_0=1$; its guarantee, $\\lceil\\log_2(w_0/\\varepsilon_x)\\rceil+4$ evaluations, is verified on all 199 problems. We nonetheless propose the scheduled projection with $c=2$, fixed before any benchmark was consulted: it is 743 evaluations cheaper on the canonical set (2634 against 3377), the earned variant is cheaper on the wide-bracket set (2073 against 2357) — one declared numerical constant and the better canonical result, or none, a tighter bound and the better wide-bracket result.")
E("**Fairness to the competitors.** Three deliberate concessions.\n\n1. ITP is natively written against a half-width $\\epsilon$ and terminates on $b-a\\le2\\epsilon$; feeding the common tolerance in as $\\epsilon$ would let it stop at twice its competitors' bracket width, so $\\epsilon=\\varepsilon_x/2$ is used.\n2. ITP is reported both at the authors' recommended constants and as a *per-problem oracle*, the best of a $(\\kappa_1,n_0)$ grid chosen separately for every problem — not an achievable method, included so that the state of the art cannot be said to have been handicapped.\n3. Our implementation of ITP is validated against the method's own theorem, that it never needs more than $n_{1/2}+n_0$ iterations, on all 154 problems for $n_0\\in\\{0,1,2,5\\}$.\n\n4. Where SciPy ships the method, the competitor **is the library**: Chandrupatla is `scipy.optimize.elementwise.find_root`, Brent is `brentq`, TOMS 748 is `toms748`, each run with the same stopping rule as every other method — a bracket no wider than $\\varepsilon_x$, the relative term at machine precision, no stopping on $|f|$ — and each evaluation counted by the same wrapper around $f$. Our own implementations of Chandrupatla's and Brent's methods agree with the libraries; the tables use the libraries. ITP has no library implementation, which is why it is checked against its own theorem instead; bisection and the false-position family are not in SciPy either and are ours.",
"**Competitors.** Where SciPy ships the method, the competitor is the library — Chandrupatla is `scipy.optimize.elementwise.find_root`, Brent `brentq`, TOMS 748 `toms748` — run with the stopping rule of every method (a bracket no wider than $\\varepsilon_x$, the relative term at machine precision, no stopping on $|f|$) and counted by the same wrapper around $f$. ITP, which has no library implementation, is ours, run with $\\epsilon=\\varepsilon_x/2$ because it terminates on $b-a\\le2\\epsilon$, checked against its own theorem ($n_{1/2}+n_0$ iterations at most, on all 154 problems for $n_0\\in\\{0,1,2,5\\}$), and reported both at the authors' constants and as a *per-problem oracle* over a $(\\kappa_1,n_0)$ grid — not an achievable method, included so that it cannot be said to have been handicapped. Bisection and the false-position family are ours.")
E("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 (§7), 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.",
"It trails Chandrupatla in total because its losses are the larger ones; by function family, the unit in which these problems are independent (§7), the comparison is 6/1/8 of 15 families, a tie. The constant-free variant goes 79/3/72 against Chandrupatla ($p=0.63$), 78/9/67 against TOMS 748 and 79/5/70 against Brent.")
E("### 5.1 What the guarantee costs\n\nIt depends on which bound is bought. Against the identical rule with no safeguard at all:\n\n| | solved | total evals | runs over the $2\\times$ bound |\n|---|---|---|---|\n| 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** |\n\nThe 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.",
"### 5.1 What the guarantee costs\n\nAgainst the same rule with no safeguard (Tables 2 and 3), the projection costs nothing on the canonical set and on the wide-bracket set solves six more problems for 30% fewer evaluations (2357 against 3391; unguarded, 10 runs break the bound). The earned projection, promising bisection plus one step, pays 743 evaluations (28%) on the canonical set and is the cheapest of the three on the wide-bracket set. That is the point of projecting rather than replacing: the two safeguards that replace cost 7068 and 7046 on Alefeld–Potra–Shi, against 2634.")
E("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.",
"For every data-derived scale the three similarities with $c=1$ occupy the top three places of Table 4 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). With the chosen scale the two groups are indistinguishable (14983 against 14228), as they should be.")
E(" 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.",
" The group order and the order of the scales were predicted before the grid was run; the order inside each group is measured.")
E("§A.6 left one decision open: *when to give the model up*. On the pure powers `fun3`–`fun6` the right move is to halve, Chandrupatla's method halves on up to all of its steps, and every reading of a single state measured so far confuses \"the model is useless here\" with something else. This section closes that decision, and the reading that closes it is not a similarity of the current state to a prototype but a similarity of the run to *its own past* — an analogy in Pólya's sense [8], two situations agreeing in more than one relation. Every rule below was pre-registered before its code and its run, with a stop rule; the rejected ones are listed in Appendix C with their numbers.",
"The base rule's gap on wide brackets is a decision, *when to give the model up* (§A.6): on the pure powers `fun3`–`fun6` the right move is to halve, Chandrupatla's method halves on up to all of its steps, and no reading of a single state measured takes that decision correctly. This section takes it by a similarity of the run to *its own past* — an analogy in Pólya's sense [8], two situations agreeing in more than one relation. Every rule below was pre-registered with a stop rule (Appendix D); the rejected ones are in Appendix C.")
E(" The constant is bisection's $\\tfrac12$, carried through the formula. The relation between the order and the contraction, $e(1-1/m)$, is the one behind the classical estimates of multiplicity from successive Newton iterates [14, 15]; here it is not used to estimate $m$ but to set the point at which a model step has lost to a halving.",
" The constant is bisection's $\\tfrac12$, carried through the formula; the contraction $e(1-1/m)$ is the one behind the classical multiplicity estimates from successive Newton iterates [14, 15], used here to set the point at which a model step has lost to a halving.")
E("The flag sees the regime — on the flat families it rises on most model steps — but acted upon step by step it does not pay. Replacing the one flagged step by a halving costs the canonical set 2634 → 2839, because a simple root far from convergence also breaks its promises (the flag rises at least once on 142 of the 154 canonical problems). Every refinement of *when* to halve that reads the moment alone — twice in a row, the promise together with a creep in one direction, a halving that sticks once begun, a judgment of the evaluated point against the line through the bracket — trades one set for the other (Appendix C, items 12–14).",
"Acted upon step by step the flag does not pay: replacing each flagged step by a halving costs the canonical set 2634 → 2839, because a simple root far from convergence also breaks its promises (the flag rises at least once on 142 of the 154 canonical problems). Every refinement that reads the moment alone trades one set for the other (Appendix C, items 12–14).")
E("Formula (6) is the log–log slope by which any power-law exponent is estimated, and has the shape of the computational order of convergence and its approximation from differences of iterates [18, 19]. What is not classical is *which* two states it compares: not consecutive iterates, but a pair the similarity of their configurations has found. Under an exact zoom a pure power of order $m$ reads exactly $m$; along a real run the analogous pairs are only nearly homothetic and the reading scatters about the order, but the regime asks only whether it reaches 2, the order from which a tangent step loses to a halving (§6.1) — no new constant.",
"Formula (6) is the log–log slope of a power law, with the shape of the computational order of convergence [18, 19]; what it compares is not consecutive iterates but a pair the similarity of their configurations has found. A real run's analogous pairs are only nearly homothetic and the reading scatters about the order, but the regime asks only whether it reaches 2, the order from which a tangent step loses to a halving (§6.1).")
E("**The analogy belongs to the run, the flag to the moment.** In the cycle the base rule runs on a pure power — undershoot, undershoot, crossing, a nearly empty step — the flag rises in the phases whose configuration does *not* recur (the empty step grows emptier every cycle), while the recurring phases have the flag down. Requiring both in one state delayed the entry on the flat problems to their thirteenth state on average. Once established, the analogy is therefore remembered for the run, and the regime is entered at the next unkept promise (eighth state on average).",
"**The analogy belongs to the run, the flag to the moment.** On a pure power the flag rises in the phases of the base rule's cycle whose configuration does *not* recur, so requiring both in one state delayed the entry to the thirteenth state on average. Once established, the analogy is remembered for the run and the regime is entered at the next unkept promise (eighth state on average).")
E(" A high power far from its root is locally an exponential, $x^m=e^{m\\ln x}$, and it was there, not on the flank of `fun9` it was built for, that the limit paid.",
" It pays on high powers far from their root, which are locally exponential, $x^m=e^{m\\ln x}$.")
E(" The order read from a *failed promise*, $(1-1/m)^m=r$, was tried first and gave $m=\\infty$ in 163 of 174 entries, because the base step is not a pure tangent; the order read from the *analogy* is the one that works.",
" (The order read from a failed promise, $(1-1/m)^m=r$, gives $m=\\infty$ in 163 of 174 entries, because the base step is not a pure tangent.)")
E(" It is a relative of Brent's acceptance condition [2], which admits an interpolant only between the best point and $(3a+b)/4$: both refuse a model that points towards the worse end of the bracket.",
" It is a relative of Brent's acceptance condition [2]: both refuse a model that points towards the worse end of the bracket.")
E(" The exit judgment of §6.2 separates a flat root from a simple one; at a root of order below one $f$ is far from 0 on both sides and the exit fires falsely, so the memory of this branch is *not* cleared by it; clearing it was measured on the development corpora and was worse (recorded in the pre-registration amendment of this branch).",
" At a root of order below one $f$ is far from 0 on both sides and the exit fires falsely, so the memory of this branch is *not* cleared by the exit (clearing it was worse on the development corpora).")
E(" Dekker [9] and Brent [2] step at least the tolerance; we do the same, $\\varepsilon_x/2$ towards the far end, when the model's step is shorter — but only after the model has *kept* its previous promise ($r<\\tfrac14$), because at the start of a run a slope dominated by a huge far value promises the root at an end. This element is not ours and is named as such.",
" Dekker [9] and Brent [2] step at least the tolerance; A′ steps $\\varepsilon_x/2$ towards the far end when the model's step is shorter, but only after the model has *kept* its previous promise ($r<\\tfrac14$). This element is borrowed.")
E(" The earned-budget form keeps its constant-free guarantee of bisection plus one step and pays for it as in §3.1.", "")
E("Every component is positive in sum; the regime and the split carry the method. Two are marginal and we say so: the step pattern earns on two corpora of six and loses on four, and the sign contradiction is within noise (+28 over 855 problems). Removing both would change A′'s total by under one per cent (117 of 13032 evaluations); they are kept because the pre-registered rule removes only a component that earns nowhere.",
"Every component is positive in sum; the regime and the split carry the method. The step pattern (earns on two corpora of six) and the sign contradiction (+28 over 855 problems) are marginal — together under one per cent, 117 of 13032 evaluations — and are kept because the pre-registered rule removes only a component that earns nowhere.")
E("Several mechanisms of A′ coincide with classical ones, and the coincidence is worth stating, because they were not taken from the literature but reached from the principles of the paper — similarity to a prototype and analogy as similarity of relations — and recognised afterwards:",
"Several mechanisms of A′ coincide with classical ones, reached from similarity and analogy and recognised afterwards:")
E("1. **New corpus 1** — 206 problems: SciPy's `original` set (6) and five generated classes of 40 (seed 20260921): smooth simple roots, transcendental simple roots, multiple roots $|x-r|^p$ with $p\\sim U(2,20)$, exponential flanks, and near-cancelling terms of the `fun9` kind.\n2. **Roots.jl / ModAB** — the published bracketing benchmark of the Julia package Roots.jl [12], taken from the ModAB benchmark of Ganchovski and Traykov [10]: 91 problems, of which 13 coincide with APS or Chandrupatla functions (a seven-point identity test) and are excluded, leaving 78, many of them discontinuous or pathological.\n3. **Applied and GSL** — the 10 bracketed problems of the GNU Scientific Library's root-finding test suite [11] and 122 equations from physics and engineering on grids fixed beforehand: Kepler's equation (eccentricity up to 0.999), Colebrook–White, Lambert's W, Planck/Wien, van der Waals for CO₂ (including near-critical), internal rate of return, the finite square well.",
"1. **New corpus 1** — 206 problems: SciPy's `original` set (6) and five generated classes of 40 (seed 20260921): smooth and transcendental simple roots, multiple roots $|x-r|^p$ with $p\\sim U(2,20)$, exponential flanks, near-cancelling terms.\n2. **Roots.jl / ModAB** — the bracketing benchmark of Roots.jl [12] used by ModAB's authors [10]: 91 problems, 13 of which coincide with APS or Chandrupatla functions and are excluded, leaving 78.\n3. **Applied and GSL** — the 10 bracketed problems of the GNU Scientific Library's test suite [11] and 122 equations from physics and engineering on grids fixed beforehand (Kepler, Colebrook–White, Lambert's W, Planck/Wien, van der Waals, internal rate of return, the finite square well).")
E("ModAB, the most recent bracketing method we know of, is run from its authors' package (`pymodab` 1.0.9, a wrapper of their C code) with the stopping rule of every other method — a bracket no wider than $\\varepsilon_x$, the relative term at machine precision, no stopping on $|f|$ — and counted by the same wrapper around $f$, whose count agrees with the package's own. Where roots are not known in closed form, and for uniformity on all six corpora, a run is solved when $f$ changes sign within $10^{-6}$ of its answer; the $x$-tolerance, the budget and the charge for a failure are those of §4.",
"ModAB, the most recent bracketing method we know of, is run from its authors' package (`pymodab` 1.0.9) with the stopping rule and the counting of every other method. The criterion, tolerance, budget and charging are those of §4.")
E("**The history is part of the result.** The variant carried to corpora 1–3 was A′ without the tolerance step and the overshoot branch. It transferred to corpus 1 by every pre-registered criterion (total 10% below Chandrupatla, per problem 105/34/67, $p=0.005$), did *not* transfer to Roots.jl (total 6.5% below, but per problem 38/10/30, $p=0.4$) and lost on the applied corpus (14% above). The losses there were traced to two gaps of the base step — no closing of the bracket once the root is reached, and no recognition of roots of order below one — which became the last two readings of §6.4; they were developed on the seen corpora and tested once, on corpus 4.",
"The variant carried to corpora 1–3 was A′ without the tolerance step and the overshoot branch. It transferred to corpus 1 by every pre-registered criterion (per problem 105/34/67 against Chandrupatla, $p=0.005$), did *not* transfer to Roots.jl (38/10/30, $p=0.4$) and lost on the applied corpus; the two readings that closed those gaps were developed on the seen corpora and tested once, on corpus 4.")
E("Against ModAB it is ahead on every corpus, in total and problem by problem ($p\\le0.0013$), on the one test of corpus 4 by 3656 to 5535 and 183 problems to 34 ($p=7\\cdot10^{-26}$), and on ModAB's own benchmark as well — all 91 problems of it, 1507 against 1588, 56/13/22 ($p=1.5\\cdot10^{-4}$); ModAB exceeds that bound, which it does not promise either, on 9 problems. Against Chandrupatla it is ahead in total on five corpora and level on the sixth, and ahead problem by problem on all six, significantly on five. The size of the lead is not uniform: it is large on multiple, fractional and nearly flat roots — the regime §6 recognises — and small on simple roots, where it is a matter of per cent. Where it is behind is named: `fun9` (65 against 55), the near-cancelling class of corpus 1 (491 against 391), random polynomials with a simple root in total (433 against 419, though ahead 20 to 12 in problems), and the smooth equations of the applied corpus, where the two are level.",
"Against ModAB it is ahead on every corpus, in total and problem by problem ($p\\le0.0013$) — on corpus 4 by 3656 to 5535 and 183 problems to 34 ($p=7\\cdot10^{-26}$), on all 91 problems of ModAB's own benchmark by 1507 to 1588 (56/13/22, $p=1.5\\cdot10^{-4}$); ModAB, which does not promise the bound either, exceeds it on 9 problems. Against Chandrupatla it is ahead in total on five corpora and level on the sixth. The lead is large on multiple, fractional and nearly flat roots and small on simple roots. It is behind on `fun9` (65 against 55), the near-cancelling class of corpus 1 (491 against 391) and random polynomials with a simple root in total (433 against 419), and level on the smooth equations of the applied corpus.")
E("A root finder can be derived from a similarity function alone, and the derivation shows where the content of such a method actually sits. 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. It is not in making the similarity change faster — that overshoots exactly as readily as flatness stagnates. It is in the *scale* against which similarity is judged: chosen, the method is brittle and merely linear; taken from the bracket, it is false position and three centuries old; read off the data, it is superlinear. And the safeguard that makes such a method safe must project the step, not replace it: replacing costs the order, projecting costs nothing on one benchmark and improves the method on the other. The projection's budget multiplier is a free constant, and we declare it: it does not move the canonical result and it does move the wide-bracket one; projecting onto a budget the steps earn instead removes it, at a measured price.",
"A root finder can be derived from a similarity function alone, and the derivation shows where its content sits: not in the shape of $S$, whose slope at the origin decides which group of functions comes first, but in the *scale* against which similarity is judged — chosen, the method is linear and brittle; taken from the bracket, it is false position; read off the most recent evaluations, it is Newton's step with Muller's order. The safeguard must project the step rather than replace it; the projection's multiplier is a free constant, declared, and a budget the steps earn removes it at a measured price.")
E("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). §A.6 locates the cause: not the order of the model but the decision to give it up, which Chandrupatla takes by halving and which no reading of a single state takes correctly for our step.",
"The base rule is level with TOMS 748 and 1.5% behind Chandrupatla's method on the canonical set, and clearly behind Chandrupatla on wide brackets (1505 against 2357); the cause is not the order of the model but the decision to give it up.")
E("That decision is a similarity too — of the run to its own past. A pure power repeats its configuration under zoom, an exponential under translation, a simple root tends to the line; the analogous pair reads the local order, the order decides between the model and a halving by bisection's own $\\tfrac12$, and it says where to split. The method built on it, A′, is ahead of Chandrupatla on both canonical sets in total and problem by problem, and on a corpus fixed after its code was frozen it needs 36% fewer evaluations and wins 177 problems to 28.",
"That decision is a similarity too, of the run to its own past: a pure power repeats its configuration under zoom, an exponential under translation, a simple root tends to the line, and the analogous pair reads the order that decides between the model and a split. The method built on it, A′, is ahead of Chandrupatla on both canonical sets, and on a corpus fixed before its code was frozen it needs 36% fewer evaluations and wins 177 problems to 28.")
E("This is the same movement as in parameter-free similarity control [6], where membership functions are eliminated by normalising the input space from the data rather than by choosing widths. Here the object normalised is the value axis, and the price of choosing it by hand is measured rather than asserted.\n\n", "")
E("Three questions remain, all narrower than the one this section used to pose.\n\n", "")
def main():
src = open(PATH, encoding="utf8").read()
bad = [o[:80] for o, _ in R if src.count(o) != 1]
if bad:
for b in bad:
print("ANCHOR NOT FOUND EXACTLY ONCE:", repr(b))
raise SystemExit(f"{len(bad)} anchors failed; nothing written")
for o, n in R:
src = src.replace(o, n)
open(PATH, "w", encoding="utf8").write(src)
main_words = len(src.split("## Appendix A.")[0].split())
print(f"applied {len(R)}; main text {main_words} words, total {len(src.split())}")
if __name__ == "__main__":
main()