"""Literature and the similarity in the step, written into article/sim_numerics.md: - the step: the similarity is NOT scaffolding - it sets the step and its form is decisive (Table 4, the audit of section 7, and the S-ablation of A', Table 9a); - related work in place: Lagouanelle (7.1, 10.5), Rall and Hansen-Patrick (8.1), the log-log slope and COC/ACOC (8.2), Schroeder and Traub (8.3), Brent's acceptance condition (8.4); - a new 8.6 'What is known and what is new', a novelty sentence in the abstract, refs 13-19. Exact anchors, each found exactly once, or nothing is written. python -u apply_article_literature.py """ from __future__ import annotations PATH = "article/sim_numerics.md" REPL = [ # --- the similarity in the step is earned, not scaffolding ------------------------- ("projected onto the bisection budget; the similarity function is scaffolding of the derivation " "and does not appear in the final rule.", "projected onto the bisection budget. The similarity sets that step, and its form is " "decisive: 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."), ("a Newton step with a three-point divided-difference derivative, clipped to the bracket and then " "projected as in §3.1. The similarity function does not appear in (4): it is scaffolding of the " "derivation, not machinery of the algorithm.", "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 §7 pay only with the tent in the step (§7, the audit of the gains), " "and in the proposed method replacing the tent by any other function costs 12% to 314% (Table 9a)."), ("We state this ourselves rather than leave it to be discovered, because it locates the " "contribution precisely. It is not a new family of methods.", "We 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."), # --- 7.1 and 10.5: Lagouanelle ------------------------------------------------------- ("The exponent $1/m$ is not a constant — $m=1/(1-ff''/f'^2)$ comes from three evaluations already " "paid for, as in item 5 of §10,", "The exponent $1/m$ is not a constant — $m=1/(1-ff''/f'^2)$, Lagouanelle's estimate of the " "multiplicity [13] with the derivatives replaced by divided differences, comes from three " "evaluations already paid for, as in item 5 of §10,"), ("measurable as $m = 1/(1-\\theta)$ with $\\theta = f f''/(f')^2$ from three divided differences and " "no constant.", "measurable as $m = 1/(1-\\theta)$ with $\\theta = f f''/(f')^2$ from three divided differences and " "no constant — which is Lagouanelle's multiplicity estimate [13]."), # --- 8.1: Rall, Hansen-Patrick ------------------------------------------------------ ("The constant is bisection's $\\tfrac12$, carried through the formula.", "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."), # --- 8.2: log-log slope, COC/ACOC --------------------------------------------------- ("Under an exact zoom a pure power of order $m$ reads exactly $m$;", "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$;"), # --- 8.3: Schroeder, Traub ---------------------------------------------------------- ("which is exact for a pure power and becomes the midpoint as $m\\to\\infty$.", "which is exact for a pure power and becomes the midpoint as $m\\to\\infty$. It is false position " "applied to $\\operatorname{sign}(f)|f|^{1/m}$ — the transformation that turns a root of " "multiplicity $m$ into a simple one, classical since Schröder [16] and Traub [17]; what is new " "here is only where $m$ comes from."), # --- 8.4: Brent's condition --------------------------------------------------------- ("and removing it alone takes the canonical set from 2806 to 2564.", "and removing it alone takes the canonical set from 2806 to 2564. 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."), ] TABLE_9A_AND_8_6 = """ **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. | $S$ in the step | APS + CHA | six corpora (855) | |---|---|---| | **tent $1-|z|$ (A′)** | **4443** | **13032** | | $e^{-|z|}$ | 4988 | 14142 | | $1/(1+|z|)$ | 5486 | 14843 | | $(1+|z|)^{-2}$ | 8360 | 28500 | | $1-\\sqrt{|z|}$ | 12718 | 45552 | | $1-|z|^{1/3}$ | 17207 | 63031 | | $e^{-z^2}$ | 18410 | 67701 | | $1/\\sqrt{1+z^2}$ | 18412 | 67854 | | $1/(1+z^2)$ | 18422 | 67394 | The 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. ### 8.6 What is known, and what is new 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: | in A′ | classical counterpart | |---|---| | the three-point order estimate of §7.1 | Lagouanelle's multiplicity estimate $m=f'^2/(f'^2-ff'')$ [13] | | the contraction $e(1-1/m)$ behind the flag of §8.1 | multiplicity estimates from successive Newton iterates [14, 15] | | the order (6) of an analogous pair | the log–log slope of a power law; the (approximate) computational order of convergence [18, 19] | | the split (7) | false position on $\\operatorname{sign}(f)|f|^{1/m}$ [16, 17] | | the half the step promises | a relative of Brent's acceptance condition [2] | | the tolerance step | Dekker [9], Brent [2] — borrowed and named as such | What we found no counterpart for, in the literature we could reach, is the part that carries the gain in Table 9: the *decision* layer. A bracketing method that recognises the regime in which its model has lost by the similarity of the run to its own past — the recurrence of a dimensionless configuration against the linear prototype — reads the order from the analogous pair itself, distinguishes similarity by scaling from similarity by translation, and leaves the regime by a similarity judgment at a point the model did not choose; and a step whose length is set by a similarity function whose form, measured, is decisive. The methods for multiple roots we found are single-point iterations without a bracket, with the multiplicity assumed, estimated from derivatives, or removed by a transformation ([17]; Roots.jl's `Order1B` and `Order2B` [12]); Chandrupatla takes the decision to halve by an empirical acceptance band [3].""" ABSTRACT_NOVELTY_OLD = "The lead is large on multiple, fractional and nearly flat roots and a matter of per cent on simple ones." ABSTRACT_NOVELTY_NEW = ( "The lead is large on multiple, fractional and nearly flat roots and a matter of per cent on simple " "ones. Several of the resulting mechanisms coincide with classical ones — Lagouanelle's multiplicity " "estimate, false position on $|f|^{1/m}$ — reached here from similarity and analogy and recognised " "afterwards; what we found no counterpart for is the decision layer, where every choice — when to " "give the model up, where to split, when to return — is a judgment of similarity or of analogy, and " "the similarity that sets the step, whose form is decisive (replacing it costs 12% to 314%)." ) REFS_ANCHOR = "commit cf1d256, 2026." REFS_ADD = """ 13. J. L. Lagouanelle, "Sur une méthode de calcul de l'ordre de multiplicité des zéros d'un polynôme," *C. R. Acad. Sci. Paris Sér. A*, vol. 262, pp. 626–627, 1966. 14. L. B. Rall, "Convergence of the Newton process to multiple solutions," *Numer. Math.*, vol. 9, pp. 23–37, 1966. 15. E. Hansen and M. Patrick, "Estimating the multiplicity of a root," *Numer. Math.*, vol. 27, pp. 121–131, 1976. 16. E. Schröder, "Ueber unendlich viele Algorithmen zur Auflösung der Gleichungen," *Math. Ann.*, vol. 2, pp. 317–365, 1870. 17. J. F. Traub, *Iterative Methods for the Solution of Equations*. Englewood Cliffs, NJ: Prentice-Hall, 1964. 18. S. Weerakoon and T. G. I. Fernando, "A variant of Newton's method with accelerated third-order convergence," *Appl. Math. Lett.*, vol. 13, pp. 87–93, 2000. 19. A. Cordero and J. R. Torregrosa, "Variants of Newton's method using fifth-order quadrature formulas," *Appl. Math. Comput.*, vol. 190, pp. 686–698, 2007.""" T9_ANCHOR = ("they are kept because the pre-registered rule removes only a component that earns " "nowhere.") def main(): with open(PATH, encoding="utf8") as fh: text = fh.read() for old, _new in REPL + [(ABSTRACT_NOVELTY_OLD, ""), (REFS_ANCHOR, ""), (T9_ANCHOR, "")]: if text.count(old) != 1: raise SystemExit(f"found {text.count(old)}x: {old[:80]}") for old, new in REPL: text = text.replace(old, new) text = text.replace(ABSTRACT_NOVELTY_OLD, ABSTRACT_NOVELTY_NEW) text = text.replace(T9_ANCHOR, T9_ANCHOR + TABLE_9A_AND_8_6) text = text.replace(REFS_ANCHOR, REFS_ANCHOR + REFS_ADD) with open(PATH, "w", encoding="utf8") as fh: fh.write(text) print("literature and the step written") if __name__ == "__main__": main()