baseline: the published sim-numerics artifact as it stands (490 tests, verify_article.py checks all 72 paper numbers against sweep_full.json)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-20 22:38:17 +01:00
co-authored by Claude Opus 5
commit 4a23aacf96
75 changed files with 12175 additions and 0 deletions
+296
View File
@@ -0,0 +1,296 @@
# Similarity as a Step Rule: Parameter-Free Root Finding Derived from a Similarity Function
V. Sitnikov
---
## Abstract
Bisection places the next iterate at the midpoint because it uses no information about the function's value. We replace that rule with a *similarity* rule: the step is proportional to how *dissimilar* the current outcome $f(x)$ is to the expectation $0$, measured by a similarity function $S:\mathbb{R}\to[0,1]$ with $S(0)=1$. We derive the contraction factor of the resulting iteration in closed form; it predicts a linear rate to four digits when $1-S$ has a non-zero slope at the origin, and a sublinear $e_n\sim C/n$ with a predicted $C$ when it does not, both confirmed. Three consequences follow. First, with the *ratio* similarity scaled by the far end — and with that combination only, of the five tested — the rule reproduces the false-position formula identically; so does the truncated linear similarity scaled by a divided difference over the *bracket ends*, which shows that the boundary of novelty runs through which points the difference is taken over. 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, the rate vanishes exactly when the scale equals the local scale of the value axis; reading that scale off the data — a divided difference, not a fitted coefficient — turns the step into $|f|/|f'|$ and the convergence superlinear.
The derivation fixes the method completely, before any benchmark is consulted: a similarity whose approach to 1 is linear, the finest available data-derived scale, and a safeguard that projects the step onto the admissible interval rather than replacing it. What results is, explicitly, a Newton step with a three-point divided-difference derivative, clipped to the bracket and projected onto the bisection budget; the similarity function is scaffolding of the derivation and does not appear in the final rule. It carries a proven worst case of twice bisection plus one step and contains no constant calibrated on a problem or on the benchmark. On the 154 problems of Alefeld, Potra and Shi it needs 2806 evaluations of $f$ against 2820 for TOMS 748 — a margin of 0.5%, which is a tie — and 2890 for Brent, whom it beats on 102 problems to 40 head to head. On the 45 problems of Chandrupatla it beats Brent 30 to 4 and TOMS 748 31 to 8, and loses to ITP. The result is parity with methods built on tuned constants, obtained without any. For every data-derived scale, the ranking of the nine similarity functions matches the derived law without exception.
---
## 1. Introduction
A bracketing root finder must decide, at every step, where inside the bracket to evaluate next. Bisection answers "in the middle", which is the correct answer when nothing is known. Every improvement since has answered "where a local model of $f$ says the root is": a secant in false position, an inverse quadratic in Brent [2], a cubic in TOMS 748 [1], an interpolate–truncate–project cycle in ITP [4]. Each of those answers carries constants: Illinois halves the stale ordinate, Brent accepts an interpolation subject to three empirical inequalities, ITP is governed by $\kappa_1,\kappa_2,n_0$.
This paper asks a different question. Suppose the only thing available is a *similarity function* — a map $S$ from an outcome to $[0,1]$, where 1 means "identical to what was wanted" and 0 means "not similar at all", in the sense used for parameter-free control in [6]. Can a root finder be built out of $S$ alone, and how does it compare with methods built out of polynomial models and tuned constants?
The answer is sharp in both directions, and the negative half is as informative as the positive half.
---
## 2. The similarity step rule
**Definition 1 (Similarity step).** Let $[a,b]$ bracket a root, $x$ be the current iterate and $x_\mathrm{far}$ the opposite end. Let $S:\mathbb{R}\to[0,1]$ with $S(0)=1$ be a similarity function and $\sigma>0$ a scale. The next iterate is
$$x' \;=\; x \;+\; \bigl(1 - S(f(x)/\sigma)\bigr)\,(x_\mathrm{far} - x). \tag{1}$$
The rule is exactly the informal statement "step further when the outcome is dissimilar to the expectation, and less far when it is similar". Bisection is the degenerate member $S\equiv\tfrac12$: a similarity function that carries no information about $f$.
### 2.1 The two-point normalisation is false position
The most obvious way to make (1) scale-free is to normalise the similarity by the two ends of the bracket, $S(a)=|f(b)|/(|f(a)|+|f(b)|)$ and $S(b)=1-S(a)$, and to place the next iterate at the similarity-weighted average of the ends.
**Proposition 1.** For the ratio similarity $S(z)=1/(1+|z|)$ with $\sigma=|f(x_\mathrm{far})|$, equivalently for the endpoint weights above,
$$S(a)\,a + S(b)\,b \;=\; \frac{a f(b) - b f(a)}{f(b)-f(a)}.$$
That is the false-position formula. Two things must be said about how far it reaches, because the obvious generalisation is false.
It 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 first and third place on Chandrupatla and one of them solves 41 of 45, where false position solves 6.
**Proposition 1'.** It is, however, specific to the *bracket ends* rather than to the ratio form. Take the truncated linear similarity $S(z)=\max(0,1-|z|)$ and the divided difference over the two ends, $\sigma=|f[a,b]|\cdot|b-a|=|f(b)-f(a)|=|f(a)|+|f(b)|$. Then $1-S=|f(a)|/(|f(a)|+|f(b)|)$, which is false position again, and the agreement is exact to the last bit.
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. In our measurements plain false position solves 127 of the 154 Alefeld–Potra–Shi problems, against 153 for bisection.
### 2.2 The contraction law
Write $e_n = x_n - r$ for the error, $D = x_\mathrm{far} - r$, and let $c$ be the slope of $1-S$ at the origin, $1-S(z) = c\,z + O(z^2)$.
**Proposition 2 (Contraction law).** For a simple root and $e_n$ small, rule (1) satisfies
$$e_{n+1} \;=\; e_n\left(1 - \frac{c\,|f'(r)|\,D}{\sigma}\right) + O(e_n^2), \qquad \text{rate} = \left|1 - \frac{c\,|f'(r)|\,D}{\sigma}\right|. \tag{2}$$
*Derivation.* $|f(x_n)| = |f'(r)|\,|e_n| + O(e_n^2)$, hence $1-S(f(x_n)/\sigma) = c\,|f'(r)|\,|e_n|/\sigma + O(e_n^2)$, and $x_\mathrm{far}-x_n = D - e_n$. Substituting into (1) and discarding second-order terms gives (2). $\square$
Table 1 checks (2) against measurement on $f(x)=x^2-2$ over $[0,2]$ with $\sigma=|f(0)|$, for which $|f'(r)|=2\sqrt2$, $D=2-\sqrt2$ and $\sigma=2$.
**Table 1.** The contraction law against measurement, all rows at the *chosen* scale $\sigma=|f(x_0)|$. $c$ is the slope of $1-S$ at the origin and $c_2$ the coefficient of $z^2$ when $c=0$.
A similarity with $c=0$ does not converge at a rate at all. Expanding $1-S=c_2z^2+O(z^4)$ in the same way as (2) gives $e_{n+1}=e_n-c_2|f'(r)|^2|D|e_n^2/\sigma^2+O(e_n^3)$, hence
$$e_n \;\simeq\; \frac{\sigma^2}{c_2\,|f'(r)|^2\,|D|}\cdot\frac1n, \tag{2a}$$
sublinear rather than stagnant. Reporting a "measured rate" for these rows would report the value of $e_{n+1}/e_n$ at whatever $n$ the window happened to end — it creeps to 1 monotonically (0.925 at $n=10$, 0.991 at $n=100$, 0.9998 at $n=4000$) — so the prediction tested is the coefficient in (2a) instead.
| $S(z)$ | $c$ | predicted | measured |
|---|---|---|---|
| $1/(1+\lvert z\rvert)$ | 1 | rate 0.1716 | 0.1716 |
| $e^{-\lvert z\rvert}$ | 1 | rate 0.1716 | 0.1716 |
| $1/(1+z^2)$ | 0, $c_2=1$ | $n\,e_n\to0.8536$ | 0.8503 |
| $e^{-z^2}$ | 0, $c_2=1$ | $n\,e_n\to0.8536$ | 0.8498 |
| $1/\sqrt{1+z^2}$ | 0, $c_2=\tfrac12$ | $n\,e_n\to1.7071$ | 1.6988 |
| $\max(0,1-\lvert z\rvert)$ | 1 | rate 0.1716 | captured, see below |
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.
**Corollary 1 (A chosen similarity is not enough).** For fixed $S$ and fixed $\sigma$ the rate in (2) depends on $|f'(r)|$, $D$ and $\sigma$, none of which is under the method's control. Convergence is at best linear and occurs only when the product lands in $(0,2)$.
Empirically, with $\sigma$ taken as $|f|$ at the starting point, five to eight of the eight standard problems fail outright for the six similarity functions tested. Those eight, used throughout as a quick set and never as evidence on their own, are: $x^2-2$ on $[0,2]$; $\cos x-x$ on $[0,1]$; $e^x-2$ on $[0,2]$; $x^3-x-2$ on $[1,2]$; $\sin x-\tfrac12$ on $[0,1.5]$; $x^{10}-1$ on $[0,1.3]$, which stalls false position; $e^{-x}(x-1)$ on $[-1,40]$, whose right end is flat to $10^{-16}$; and $\arctan x$ on $[-1,3]$.
**Corollary 2 (Missing the calibration in either direction costs).** The rate degrades as the product $c\,|f'(r)|\,|D|/\sigma$ departs from 1, upwards or downwards. We claim no symmetry between the two directions, and the measurements do not support one: similarities with unbounded slope — $1-\sqrt{|z|}$ has $c\approx3.2\cdot10^{3}$ at the resolution used, $1-|z|^{1/3}$ has $c\approx4.6\cdot10^{4}$ — fail on five and six of the eight problems with a chosen scale, 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.
**Corollary 3 (The scale must come from the data).** The rate is zero exactly when $c\,|f'(r)|\,D/\sigma = 1$, i.e. $\sigma = c\,|f'(r)|\,D$. Substituting this $\sigma$ back into (1) with $c=1$ gives $x' - x = |f(x)|/|f'|$, the Newton step. The similarity rule is therefore superlinear precisely when its scale is the *local scale of the value axis*, and that scale is not available a priori: it must be read off the evaluations.
---
## 3. The method
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.
**Similarity: any with $c\neq0$.** The law makes the shape of $S$ almost irrelevant and its slope at the origin decisive. We take the plainest member, the **truncated linear** or tent form $S(z)=\max(0,1-|z|)$. 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.
**Scale: the finest data-derived one.** We set $\sigma = |\hat f'|\cdot|x_\mathrm{far}-x|$ with $\hat f'$ a divided difference of the **most recent evaluations** — not of the bracket ends, which by Proposition 1' would give false position. A divided difference is a computation, not a fitted coefficient: nothing is chosen, regressed or tuned. The two-point difference has slope error $O(h)$ and gives the secant order $\varphi\approx1.618$; the three-point difference — the derivative at $x_n$ of the parabola through the last three evaluations, $\hat f' = f[x_{n-1},x_n] + f[x_{n-2},x_{n-1},x_n](x_n-x_{n-1})$ — 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.
**What the rule reduces to.** With $S(z)=\max(0,1-|z|)$ one has $1-S=\min(1,|z|)$, and (1) becomes
$$x' \;=\; x + \operatorname{sign}(x_\mathrm{far}-x)\cdot\min\!\Bigl(\frac{|f(x)|}{|\hat f'|},\;|x_\mathrm{far}-x|\Bigr), \tag{4}$$
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.
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. It is (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; (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 §7; (iv) the measurements.
**Algorithm.** Given $[a,b]$ with $f(a)f(b)<0$ and tolerance $\varepsilon_x$:
```
evaluate fa = f(a), fb = f(b)
A, B <- a, b the proven bracket
x <- the endpoint with the smaller |f|; xp <- the other; xp2 <- none
n_max <- 2 * ceil(log2(|b-a| / xtol)); allow <- 2^n_max * xtol/2
while |B - A| > xtol:
far <- the end of [A,B] further from x
f' <- derivative at x of the parabola through (x,xp,xp2)
(two-point difference while xp2 does not yet exist)
sigma <- |f'| * |far - x|
if sigma is 0 or not finite: xn <- midpoint(A,B)
else:
xn <- x + min(1, |f(x)|/sigma) * (far - x) # the step, eq (4)
xn <- clamp(xn, hi - allow, lo + allow) # projection, eq (3)
if xn outside (A,B) or already evaluated: xn <- midpoint(A,B)
evaluate fn = f(xn); allow <- allow / 2
xp2, xp, x <- xp, x, xn
update the bracket: whichever of A,B keeps the sign change
return midpoint(A,B)
```
Every quantity in it is either an evaluation of $f$, a divided difference of evaluations, or the halving that defines bisection. There is no line in which a value was chosen.
### 3.1 The safeguard: project, do not replace
An interpolation-only rule has no worst-case bound. The obvious safeguards *replace* the computed step with a midpoint whenever some progress test fails, and all of them are ruinous here, for a reason specific to a fast method: a step that collapses the *error* need not halve the *bracket*, so a bracket-based test fires on exactly the steps that were best. 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.
The remedy is to keep as much of the computed step as the budget allows. Let $n_\max=2\lceil\log_2(w_0/\varepsilon_x)\rceil$ be twice the bisection step count for the initial width $w_0$ and $x$-tolerance $\varepsilon_x$, and let $\epsilon=\varepsilon_x/2$. At step $j$, with the bracket $[\ell,h]$, define the allowance and the projection
$$\alpha_j = 2^{\,n_\max-j}\epsilon, \qquad x \;=\; \operatorname{clamp}\bigl(x_\mathrm{sim},\; h-\alpha_j,\; \ell+\alpha_j\bigr). \tag{3}$$
The next bracket is at most $\max(x-\ell,\,h-x)$, so (3) gives $w_{j+1}\le\alpha_j$ directly, and induction bounds the run by $n_\max$ steps in exact arithmetic. In floating point the bracket can land exactly on the boundary, and the termination test then asks for one more; the guarantee stated and verified is therefore $2\lceil\log_2(w_0/\varepsilon_x)\rceil+3$ evaluations.
Three remarks on why this introduces nothing.
- **The doubling is not a tuning constant.** It is the factor already claimed in the bound. Zero slack — $n_\max=\lceil\log_2(w_0/\varepsilon_x)\rceil$, a worst case of exactly bisection — is degenerate and was measured as such: a worst case of exactly bisection demands a halving at *every* step, so the projection has no freedom, the radius on a unit bracket is 0.05 from the first step, and the guard behaves as bisection.
- **This is ITP's projection stage without ITP's truncation stage.** All three of ITP's constants live in the truncation, whose purpose is to repair regula falsi; the similarity step needs no repair, so the truncation and every constant with it are dropped.
- **Writing the clamp in the form (3) rather than as a radius $\alpha_j-w_j/2$ about the midpoint is not cosmetic.** That radius is a difference of two nearly equal numbers; the cancellation made the computed radius too large by a relative $8.9\cdot10^{-5}$, which broke the invariant on eleven Chandrupatla problems.
---
## 4. Experimental protocol
**Problem sets.** The 154 problems of Alefeld, Potra and Shi [1] and the 45 of Chandrupatla [3], taken programmatically from SciPy's `scipy.optimize._tstutils` so that no bracket or root is transcribed by hand.
**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. *Failures are charged the full budget*, so no method can buy a low total by giving up early, and totals are reported over all problems rather than over the subset a method happened to solve. Rankings are by failures first, then by total.
**Fairness to the competitors.** Three deliberate concessions.
1. 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.
2. 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.
3. 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\}$.
4. Where SciPy ships the method, the competitor is run at **the better of SciPy's implementation and ours, problem by problem**. This is not a formality. Our implementations turned out to be slightly *cheaper* than the library's — 6991 evaluations against `brentq`'s 7004, and 5209 against `_chandrupatla`'s 5228 — so quoting the library figure alone would have flattered us by a fifth of a percent, which on a 0.5% margin is not nothing. The two agree on 191 of 199 problems for Brent and 179 of 199 for Chandrupatla, the differences being one or two evaluations from the relative-tolerance term in the stopping rules. 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.
**Reproducibility.** All numbers come from a single Linux run. The test functions call `libm`, whose last digit differs between platforms; the same SciPy version scores 2819 for TOMS 748 on Windows and 2820 on Linux for the same set. Every number stated in this paper is checked against the run data by a script that is part of the test suite.
---
## 5. Results
The grid is nine similarity functions × four scales × six safeguards = 216 configurations, plus ten baselines. The configuration proposed in Section 3 — ratio similarity, three-point scale, projection safeguard — is one entry of that grid, fixed by the theory rather than chosen from the ranking.
**Table 2.** Alefeld–Potra–Shi, 154 problems, out of 226 configurations.
| # | configuration | tuned | solved | total evals | $>2\times$ |
|---|---|---|---|---|---|
| **1** | **proposed: tent, 3-point, projection** | **no** | 153/154 | **2806** | 0 |
| 2 | the same rule with no safeguard at all | no | 153/154 | 2806 | 0 |
| 3 | TOMS 748 | yes | 153/154 | 2820 | 0 |
| 4 | Brent | yes | 153/154 | 2890 | 0 |
| 11 | ITP, per-problem oracle | yes | 153/154 | 3260 | 0 |
| 18 | Ridders | no | 153/154 | 3313 | 0 |
| 31 | ITP, recommended constants | yes | 153/154 | 3957 | 0 |
| 61 | Illinois | yes | 153/154 | 7045 | 0 |
| 65 | bisection | no | 153/154 | 7530 | 0 |
| 206 | false position | no | 127/154 | 10560 | — |
On the problems both solve, the proposed configuration beats Brent 102/11/40 (wins/ties/losses), TOMS 748 86/16/51, ITP at its recommended constants 132/3/18, the per-problem ITP oracle 121/4/28, and bisection 152/1/0.
**Table 3.** Chandrupatla, 45 problems, brackets up to $10^{12}$ wide.
| # | configuration | tuned | solved | total evals |
|---|---|---|---|---|
| 1 | similarity, $1-\sqrt{\lvert z\rvert}$, bracket scale, projection | no | **41/45** | 4516 |
| 2 | ITP, per-problem oracle | yes | 40/45 | 2611 |
| 3 | similarity, $e^{-\lvert z\rvert}$, bracket scale, both guards | no | 40/45 | 2733 |
| 5 | ITP, recommended constants | yes | 40/45 | 2857 |
| 6 | bisection | no | 40/45 | 3090 |
| **10** | **proposed: tent, 3-point, projection** | **no** | 40/45 | **3220** |
| 127 | TOMS 748 | yes | 40/45 | 4000 |
| 189 | Brent | yes | 38/45 | 4101 |
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. The proposed configuration is tenth by total and beats Brent 30/4/4 and TOMS 748 31/1/8, while losing to ITP 17/0/23 and to the ITP oracle 16/0/24.
### 5.1 What the guarantee costs
Nothing on one set, and less than nothing on the other. Against the identical rule with no safeguard at all:
| | solved | total evals | runs over the $2\times$ bound |
|---|---|---|---|
| APS, no safeguard | 153/154 | 2806 | 0 |
| APS, projection | 153/154 | 2806 | 0 |
| Chandrupatla, no safeguard | 35/45 | 4104 | 10 |
| Chandrupatla, projection | **40/45** | **3220** | **0** |
On the canonical set the projection never binds and the totals are identical to the last evaluation. On the wide-bracket set it solves five more problems for 21% fewer evaluations. This is the opposite of the usual trade, and it is the point of projecting rather than replacing: the two safeguards that replace cost 7260 and 7239 on Alefeld–Potra–Shi, against 2806.
### 5.2 Wall-clock time, and why it is not the cost model
Evaluations of $f$ are the cost model because in any real problem $f$ is the expensive part. Wall-clock time measures something narrower — the method's own arithmetic per step — and it is implementation- and language-bound. We report it because a reader will ask, and because what it shows is instructive.
On the 199 problems as they stand, every $f$ being a formula of a few operations, the proposed 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.
Those 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 proposed rule, 5932 against 6991 for Brent, 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.
That inversion is the point. Making $f$ progressively more expensive by a controlled amount of arithmetic and timing the sweep directly — nothing subtracted, nothing modelled — the proposed rule overtakes ITP once one call to $f$ costs about 9 µs and Brent at about 20 µs, which on this machine is of the order of a hundred arithmetic operations. Below that the ranking is decided by per-step overhead; above it, by evaluations.
Three caveats, all of them limitations of the measurement rather than of the methods. Timings vary by tens of percent between runs even on an idle machine. An attempt to separate our per-step cost into "algorithm" and "Python call overhead", by timing a flattened rewrite of the same rule, produced a variant that diverged from the original on 42 of the 199 problems and was therefore discarded rather than quoted; the question stays open. And an earlier version of this measurement estimated a per-evaluation overhead by subtracting the measured cost of $f$, which returned *negative* overheads for four of six methods — an impossibility that condemned the estimator, and the reason nothing is subtracted here.
### 5.3 The law across the whole grid
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.
**Table 4.** Mean total evaluations over both sets, step guard, grouped by the slope $c$ of $1-S$ at the origin.
| scale | $c=1$ (linear approach) | $c=0$ (quadratic approach) |
|---|---|---|
| 3-point derived | **6809** | 22294 |
| 2-point derived | 6906 | 22167 |
| bracket | 10263 | 19137 |
| start (chosen) | 16102 | 15345 |
Ranked individually and best over scales, the similarities come out $1-|z|$ (6496), $e^{-|z|}$ (6822), $1/(1+|z|)$ (7038), $(1+|z|)^{-2}$ (9502), $1-\sqrt{|z|}$ (10497), $1-|z|^{1/3}$ (11941), $e^{-z^2}$ (14314), $1/(1+z^2)$ (15102), $1/\sqrt{1+z^2}$ (16394); the scales come out 3-point (6496), 2-point (6628), bracket (9081), start (14540). Both orderings are those the law predicts, and both were predicted before the grid was run.
---
## 6. Where the evaluations go
Splitting each run at the geometric mean of the initial width and the attainable tolerance — the log-midpoint of the journey, at which bisection by construction has spent half its evaluations — separates the *approach* from the *endgame*. On Alefeld–Potra–Shi the two-point rule spends 2235 on the approach and 668 on the endgame against Brent's 2175 and 515: its deficit is almost entirely the endgame, i.e. the order, which is what motivated the three-point scale. On Chandrupatla it spends 1068 and 1161 against Brent's 1343 and 1358, winning both phases.
Two natural explanations of the Chandrupatla advantage were tested and *refuted*. Brent discards 53.3% of its interpolations to its safeguard on the set it wins and only 34.0% on the set it loses, so safeguard rate is not the mechanism; and on Chandrupatla Brent is the bolder of the two — 56.3% of its probes land in the outer tenths of the bracket against our 41.8% — so step length is not the mechanism either.
The mechanism is step *quality*. Reconstructing each method's bracket from the signs it observed, the median probe removes 0.500 of the bracket for every method on Alefeld–Potra–Shi, 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. The similarity rule makes the weakest available assumption — a single local slope — and degrades gracefully.
---
## 7. Negative results
1. **The prototype-aggregation form of the method loses.** A richer construction — prototypes over *pairs* of evaluated points, softmax weights over the whole memory, similarity on both the value and the abscissa axis — leads on eight hand-picked problems but loses decisively on the real set: 0 wins, 6 ties and 147 losses against Brent. The simplest form of the idea won.
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. Only projection preserves both. We record this because it is the trap the construction naturally falls into.
3. **Zero slack in the projection is degenerate.** A worst case of exactly bisection demands a halving at every step and leaves the projection no freedom at all.
4. **Regimes exist, at the level of a function family, and cannot be exploited by a switch.** The cube-root similarity beats the proposed rule on all five members of Chandrupatla's `fun4` — 32/32/40/47/59 against 89/93/113/125/153, a factor of 2.6 — and consistency across a family at different parameters is the signature of structure rather than luck. But the same similarity over the whole Chandrupatla set costs 4099 against 3220, so a switch chosen per benchmark is worse than no switch at all: 6905 against 6026 over both sets. The scale axis offers only 5.3% headroom even to an oracle handed the best scale per problem, two thirds of it inside a single problem family, and the winners are not separated by anything the method can see before it commits — the proposed scale wins on bracket widths from $10^0$ to $10^{12}$.
5. **The phase detector: derivation sound, estimator not.** Redoing the contraction law without the assumption $|f|\approx|f'(r)|e$ — taking $|f|\approx K e^m$ instead — does produce the march exponent on its own, $p = L/(L-\ln m)$ with $L=\ln(e/D)$, giving $p=1$ at a simple root and dropping to 0.50 and 0.23 as the approach flattens, which is the neighbourhood of the cube root that wins those families. Substituted back it collapses to the multiplier $m$, measurable as $m = 1/(1-\theta)$ with $\theta = f f''/(f')^2$ from three divided differences and no constant. It preserves the order (2.001) and improves the eight standard problems (82 against 84) — and loses on the full benchmark, 6304 against 6026. The estimator is the failure: on Alefeld–Potra–Shi, where almost every root is simple and the truth is $m=1$, it reports $m>1$ on 27.9% of steps with excursions to $m=34.8$, against 35.8% on the flat families. 27.9 against 35.8 is no separation. 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.
6. **One problem defeats 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 machine zero at distance up to 0.086 from the root.
7. **The symmetric ratio similarity degenerates.** For $S(x,y)=\min(|x|,|y|)/\max(|x|,|y|)$ with $y$ the target 0, $S\equiv0$; the only usable reading is $1-|f|/\sigma$, which saturates and stagnates (Table 1, last row).
---
## 8. Conclusion
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 their ranking 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 resulting rule has no tuning 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 — 2806 evaluations against 2820 is a margin of 0.5% and should be read as a tie — and ahead of Brent by 2.9%, which it also beats 102 problems to 40 head to head. The claim the measurements support is parity with methods that carry tuned constants, not superiority over them.
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.
### Future work
One weakness has a clear diagnosis and no fix inside this framework. On brackets many orders of magnitude wider than the distance to the root, the search must cross those decades, and an *additive* step of $|f|/|f'|$ is sized by the local slope, which knows nothing about how many decades remain. That is why the cube-root similarity, whose step is a fixed *fraction* of the bracket, beats the proposed rule 2.6-fold on those families, and why ITP keeps its lead on the Chandrupatla set.
The regime is therefore multiplicative versus additive movement, not one similarity function versus another — a change of the space the method works in, not of a coefficient inside it. The natural instrument is a logarithmic change of variable, $u = \operatorname{sign}(x-c)\log(1+|x-c|/s)$, in which an additive step becomes a geometric march and the exponent that the cube root fixes at $1/3$ by accident disappears as a free quantity. Two conditions decide whether that is a method or another refuted idea: the origin $c$ and unit $s$ must be read from the bracket rather than chosen, and the transform must be the identity to within rounding on narrow brackets, so that the wide-bracket families are not bought at the price of the canonical set. Every attempt reported in §7 failed on exactly that second condition.
---
## References
1. G. E. Alefeld, F. A. Potra and Y. Shi, "Algorithm 748: Enclosing zeros of continuous functions," *ACM Trans. Math. Softw.*, vol. 21, no. 3, pp. 327–344, 1995.
2. R. P. Brent, *Algorithms for Minimization without Derivatives*. Englewood Cliffs, NJ: Prentice-Hall, 1973.
3. T. R. Chandrupatla, "A new hybrid quadratic/bisection algorithm for finding the zero of a nonlinear function without using derivatives," *Adv. Eng. Software*, vol. 28, no. 3, pp. 145–149, 1997.
4. I. F. D. Oliveira and R. H. C. Takahashi, "An enhancement of the bisection method average performance preserving minmax optimality," *ACM Trans. Math. Softw.*, vol. 47, no. 1, pp. 1–24, 2021.
5. C. Ridders, "A new algorithm for computing a single root of a real continuous function," *IEEE Trans. Circuits Syst.*, vol. 26, no. 11, pp. 979–980, 1979.
6. V. Sitnikov, "Parameter-free similarity control," preprint, 2026.
7. M. Dowell and P. Jarratt, "A modified regula falsi method for computing the root of an equation," *BIT*, vol. 11, pp. 168–174, 1971.
Binary file not shown.
+618
View File
@@ -0,0 +1,618 @@
%% =====================================================================
%% STALE. This file lags behind article/sim_numerics.md, which is the
%% current text. Do not build a PDF from it and do not send it out.
%%
%% The .md has taken the first pass of revision corrections; this file
%% still contains statements that pass showed to be wrong:
%% - the proposed similarity called "ratio" (it is the truncated
%% linear / tent form; the ratio form is a different row)
%% - Proposition 1 stated for similarity rules in general (it holds
%% for the ratio form scaled by the far end, and for no other of
%% the five tested)
%% - Table 1's c = 0 rows given a "measured rate" (there is no rate;
%% the behaviour is sublinear, e_n ~ C/n with a predicted C)
%% - the three-point order given as 1.84 (it is 2)
%% - section 5.2 evaluation counts not reconciled with section 5
%%
%% It will be regenerated from the .md once the text settles.
%% =====================================================================
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{booktabs}
\usepackage[margin=2.5cm]{geometry}
\usepackage{hyperref}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\title{Similarity as a Step Rule:\\
Parameter-Free Root Finding Derived from a Similarity Function}
\author{V. Sitnikov}
\date{}
\begin{document}
\maketitle
\begin{abstract}
Bisection places the next iterate at the midpoint because it uses no
information about the function's value. We replace that rule with a
\emph{similarity} rule: the step is proportional to how \emph{dissimilar} the
current outcome $f(x)$ is to the expectation $0$, measured by a similarity
function $S\colon\mathbb{R}\to[0,1]$ with $S(0)=1$. We derive the contraction
factor of the resulting iteration in closed form and confirm it numerically to
four digits. Three consequences follow and are all verified. First, the
two-point normalisation of $S$ over the bracket reproduces the false-position
formula identically, so a similarity rule calibrated by the bracket is not a
new method. Second, any similarity function fixed in advance yields at best
linear convergence at a rate that is a property of the problem rather than of
the method; on eight standard problems, five to eight of them fail. Third, the
rate vanishes exactly when the similarity's scale equals the local scale of the
value axis; reading that scale off the data --- a divided difference, not a
fitted coefficient --- turns the step into $|f|/|f'|$ and the convergence
superlinear.
The derivation fixes the method completely, before any benchmark is consulted:
a similarity whose approach to $1$ is linear, the finest available data-derived
scale, and a safeguard that projects the step onto the admissible interval
rather than replacing it. That configuration carries a proven worst case of
twice bisection plus one step and contains no tuning constant of any kind. On
the $154$ problems of Alefeld, Potra and Shi it needs $2806$ evaluations of $f$
against $2820$ for TOMS\,748 --- a margin of $0.5\%$, which is a tie --- and
$2890$ for Brent, whom it beats on $102$ problems to $40$ head to head. On the
$45$ problems of Chandrupatla it beats Brent $30$ to $4$ and TOMS\,748 $31$ to
$8$, and loses to ITP. The result is parity with methods built on tuned
constants, obtained without any.
The ranking of the nine similarity functions across the whole grid matches the
derived law without exception.
\end{abstract}
\section{Introduction}
A bracketing root finder must decide, at every step, where inside the bracket
to evaluate next. Bisection answers ``in the middle'', which is the correct
answer when nothing is known. Every improvement since has answered ``where a
local model of $f$ says the root is'': a secant in false position, an inverse
quadratic in Brent~\cite{brent}, a cubic in TOMS\,748~\cite{aps}, an
interpolate--truncate--project cycle in ITP~\cite{itp}. Each of those answers
carries constants: Illinois halves the stale ordinate, Brent accepts an
interpolation subject to three empirical inequalities, ITP is governed by
$\kappa_1,\kappa_2,n_0$.
This paper asks a different question. Suppose the only thing available is a
\emph{similarity function} --- a map $S$ from an outcome to $[0,1]$, where $1$
means ``identical to what was wanted'' and $0$ means ``not similar at all'',
in the sense used for parameter-free control in~\cite{sim}. Can a root finder
be built out of $S$ alone, and how does it compare with methods built out of
polynomial models and tuned constants?
The answer is sharp in both directions, and the negative half is as informative
as the positive half.
\section{The similarity step rule}
\begin{definition}[Similarity step]
Let $[a,b]$ bracket a root, $x$ be the current iterate and $x_{\mathrm{far}}$
the opposite end. Let $S\colon\mathbb{R}\to[0,1]$ with $S(0)=1$ be a similarity
function and $\sigma>0$ a scale. The next iterate is
\begin{equation}
\label{eq:step}
x' \;=\; x \;+\; \bigl(1 - S(f(x)/\sigma)\bigr)\,(x_{\mathrm{far}} - x).
\end{equation}
\end{definition}
The rule is exactly the informal statement ``step further when the outcome is
dissimilar to the expectation, and less far when it is similar''. Bisection is
the degenerate member $S\equiv\tfrac12$: a similarity function that carries no
information about $f$.
\subsection{The two-point normalisation is false position}
The most obvious way to make~\eqref{eq:step} scale-free is to normalise the
similarity by the two ends of the bracket, $S(a)=|f(b)|/(|f(a)|+|f(b)|)$ and
$S(b)=1-S(a)$, and to place the next iterate at the similarity-weighted average
of the ends.
\begin{proposition}
\label{prop:falsi}
$S(a)\,a + S(b)\,b \;=\; \dfrac{a f(b) - b f(a)}{f(b)-f(a)}$.
\end{proposition}
That is the false-position formula. The identity is elementary but decisive: a
similarity rule whose scale is taken from the bracket is not a new method, and
it inherits false position's stalling failure. In our measurements plain false
position solves $127$ of the $154$ Alefeld--Potra--Shi problems, against $153$
for bisection.
\subsection{The contraction law}
Write $e_n = x_n - r$ for the error, $D = x_{\mathrm{far}} - r$, and let $c$ be
the slope of $1-S$ at the origin, $1-S(z) = c\,z + O(z^2)$.
\begin{proposition}[Contraction law]
\label{prop:law}
For a simple root and $e_n$ small, rule~\eqref{eq:step} satisfies
\begin{equation}
\label{eq:law}
e_{n+1} \;=\; e_n\left(1 - \frac{c\,|f'(r)|\,D}{\sigma}\right) + O(e_n^2),
\qquad
\text{rate} = \left|1 - \frac{c\,|f'(r)|\,D}{\sigma}\right| .
\end{equation}
\end{proposition}
\begin{proof}[Derivation]
$|f(x_n)| = |f'(r)|\,|e_n| + O(e_n^2)$, hence
$1-S(f(x_n)/\sigma) = c\,|f'(r)|\,|e_n|/\sigma + O(e_n^2)$, and
$x_{\mathrm{far}}-x_n = D - e_n$. Substituting into~\eqref{eq:step} and
discarding second-order terms gives~\eqref{eq:law}.
\end{proof}
Table~\ref{tab:law-check} checks~\eqref{eq:law} against measurement on
$f(x)=x^2-2$ over $[0,2]$ with $\sigma=|f(0)|$, for which $|f'(r)|=2\sqrt2$,
$D=2-\sqrt2$ and $\sigma=2$.
\begin{table}[h]
\centering
\caption{The contraction law against measurement. $c$ is the slope of $1-S$ at
the origin. Similarities that approach $1$ quadratically have $c=0$ and are
predicted to stagnate.}
\label{tab:law-check}
\begin{tabular}{lrrr}
\toprule
$S(z)$ & $c$ & predicted rate & measured rate\\
\midrule
$1/(1+|z|)$ & $1$ & $0.1716$ & $0.1716$\\
$e^{-|z|}$ & $1$ & $0.1716$ & $0.1716$\\
$1/(1+z^2)$ & $0$ & $1.0000$ & $0.9357$\\
$e^{-z^2}$ & $0$ & $1.0000$ & $0.9444$\\
$1/\sqrt{1+z^2}$ & $0$ & $1.0000$ & $0.9327$\\
$\max(0,1-|z|)$ & $1$ & $0.1716$ & $1.0000$ (saturates)\\
\bottomrule
\end{tabular}
\end{table}
\begin{corollary}[A chosen similarity is not enough]
\label{cor:chosen}
For fixed $S$ and fixed $\sigma$ the rate in~\eqref{eq:law} depends on
$|f'(r)|$, $D$ and $\sigma$, none of which is under the method's control.
Convergence is at best linear and occurs only when the product lands in
$(0,2)$.
\end{corollary}
Empirically, with $\sigma$ taken as $|f|$ at the starting point, five to eight
of eight standard problems fail outright for the six similarity functions
tested.
\begin{corollary}[Faster is not better]
\label{cor:faster}
Increasing $c$ moves the rate away from $1$ in either direction. Similarities
with unbounded slope --- $1-\sqrt{|z|}$ has $c\approx3.2\cdot10^{3}$ at the
resolution used, $1-|z|^{1/3}$ has $c\approx4.6\cdot10^{4}$ --- overshoot as
readily as flat ones stagnate, and fail on five and six of the eight problems
respectively.
\end{corollary}
\begin{corollary}[The scale must come from the data]
\label{cor:derived}
The rate is zero exactly when $c\,|f'(r)|\,D/\sigma = 1$, i.e.
$\sigma = c\,|f'(r)|\,D$. Substituting this $\sigma$ back into~\eqref{eq:step}
with $c=1$ gives $x' - x = |f(x)|/|f'|$, the Newton step. The similarity rule
is therefore superlinear precisely when its scale is the \emph{local scale of
the value axis}, and that scale is not available a priori: it must be read off
the evaluations.
\end{corollary}
\section{The method}
Corollaries~\ref{cor:chosen}--\ref{cor:derived} fix every choice in the method
before any benchmark is consulted. We record them here as a prediction, and
Section~\ref{sec:grid} tests it against the full grid.
\paragraph{Similarity: any with $c\neq0$.} The law makes the shape of $S$
almost irrelevant and its slope at the origin decisive. We take the plainest
member, the ratio form $S(z)=\max(0,1-|z|)$.
\paragraph{Scale: the finest data-derived one.} We set
$\sigma = |\hat f'|\cdot|x_{\mathrm{far}}-x|$ with $\hat f'$ a divided
difference of the most recent evaluations. A divided difference is a
computation, not a fitted coefficient: nothing is chosen, regressed or tuned.
The two-point difference has slope error $O(h)$ and gives the secant order
$\varphi\approx1.618$; the three-point difference --- the derivative at $x_n$
of the parabola through the last three evaluations,
$\hat f' = f[x_{n-1},x_n] + f[x_{n-2},x_{n-1},x_n](x_n-x_{n-1})$ --- has error
$O(h^2)$ and lifts it. Measured medians are $1.584$ and $1.944$, against
$1.809$ for Brent and $2.654$ for TOMS\,748.
\subsection{The safeguard: project, do not replace}
\label{sec:guard}
An interpolation-only rule has no worst-case bound. The obvious safeguards
\emph{replace} the computed step with a midpoint whenever some progress test
fails, and all of them are ruinous here, for a reason that is specific to a
fast method: a step that collapses the \emph{error} need not halve the
\emph{bracket}, so a bracket-based test fires on exactly the steps that were
best. 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.
The remedy is to keep as much of the computed step as the budget allows.
Let $n_{\max}=2\lceil\log_2(w_0/\varepsilon_x)\rceil$ be twice the bisection
step count for the initial width $w_0$ and $x$-tolerance $\varepsilon_x$, and
let $\epsilon=\varepsilon_x/2$. At step $j$, with the bracket $[\ell,h]$,
define the allowance and the projection
\begin{equation}
\label{eq:proj}
\alpha_j = 2^{\,n_{\max}-j}\epsilon,
\qquad
x \;=\; \operatorname{clamp}\bigl(x_{\mathrm{sim}},\; h-\alpha_j,\; \ell+\alpha_j\bigr).
\end{equation}
The next bracket is at most $\max(x-\ell,\,h-x)$, so~\eqref{eq:proj} gives
$w_{j+1}\le\alpha_j$ directly, and induction bounds the run by $n_{\max}$ steps
in exact arithmetic. In floating point the bracket can land exactly on the
boundary, and the termination test then asks for one more; the guarantee
stated and verified is therefore
$2\lceil\log_2(w_0/\varepsilon_x)\rceil+3$ evaluations.
Three remarks on why this introduces nothing.
\begin{itemize}
\item \textbf{The doubling is not a tuning constant.} It is the factor already
claimed in the bound. Zero slack --- $n_{\max}=\lceil\log_2(w_0/\varepsilon_x)\rceil$,
a worst case of exactly bisection --- is degenerate and was measured as such: a
worst case of exactly bisection demands a halving at \emph{every} step, so the
projection has no freedom, the radius on a unit bracket is $0.05$ from the
first step, and the guard behaves as bisection.
\item \textbf{This is ITP's projection stage without ITP's truncation stage.}
All three of ITP's constants live in the truncation, whose purpose is to repair
regula falsi; the similarity step needs no repair, so the truncation and every
constant with it are dropped.
\item \textbf{Writing the clamp in the form~\eqref{eq:proj} rather than as a
radius $\alpha_j-w_j/2$ about the midpoint is not cosmetic.} That radius is a
difference of two nearly equal numbers; the cancellation made the computed
radius too large by a relative $8.9\cdot10^{-5}$, which broke the invariant on
eleven Chandrupatla problems.
\end{itemize}
\section{Experimental protocol}
\paragraph{Problem sets.} The $154$ problems of Alefeld, Potra and Shi~\cite{aps}
and the $45$ of Chandrupatla~\cite{chandrupatla}, taken programmatically from
SciPy's \texttt{scipy.optimize.\_tstutils} so that no bracket or root is
transcribed by hand.
\paragraph{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. \emph{Failures are charged
the full budget}, so no method can buy a low total by giving up early, and
totals are reported over all problems rather than over the subset a method
happened to solve. Rankings are by failures first, then by total.
\paragraph{Fairness to the competitors.} Three deliberate concessions.
(i)~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. (ii)~ITP is reported both at the authors' recommended constants and as a
\emph{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. (iii)~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\}$.
\paragraph{Reproducibility.} All numbers come from a single Linux run. The test
functions call \texttt{libm}, whose last digit differs between platforms; the
same SciPy version scores $2819$ for TOMS\,748 on Windows and $2820$ on Linux
for the same set. Every number stated in this paper is checked against the run
data by a script that is part of the test suite.
\section{Results}
The grid is nine similarity functions $\times$ four scales $\times$ six
safeguards $=216$ configurations, plus ten baselines. The configuration
proposed in Section~3 --- ratio similarity, three-point scale, projection
safeguard --- is one entry of that grid, fixed by the theory rather than chosen
from the ranking.
\begin{table}[h]
\centering
\caption{Alefeld--Potra--Shi, $154$ problems, out of $226$ configurations.}
\label{tab:aps}
\begin{tabular}{rlccrr}
\toprule
\# & configuration & tuned & solved & total evals & $>2\times$\\
\midrule
1 & \textbf{proposed: ratio, 3-point, projection} & \textbf{no} & 153/154 & \textbf{2806} & 0\\
3 & TOMS\,748 & yes & 153/154 & 2820 & 0\\
4 & Brent & yes & 153/154 & 2890 & 0\\
11 & ITP, per-problem oracle & yes & 153/154 & 3260 & 0\\
18 & Ridders & no & 153/154 & 3313 & 0\\
31 & ITP, recommended constants & yes & 153/154 & 3957 & 0\\
61 & Illinois & yes & 153/154 & 7045 & 0\\
65 & bisection & no & 153/154 & 7530 & 0\\
206 & false position & no & 127/154 & 10560 & --\\
\bottomrule
\end{tabular}
\end{table}
On the problems both solve, the proposed configuration beats Brent
$102/11/40$ (wins/ties/losses), TOMS\,748 $86/16/51$, ITP at its recommended
constants $132/3/18$, the per-problem ITP oracle $121/4/28$, and bisection
$152/1/0$.
\begin{table}[h]
\centering
\caption{Chandrupatla, $45$ problems, brackets up to $10^{12}$ wide.}
\label{tab:cha}
\begin{tabular}{rlccr}
\toprule
\# & configuration & tuned & solved & total evals\\
\midrule
1 & similarity, $1-\sqrt{|z|}$, bracket scale, projection & no & \textbf{41/45} & 4516\\
2 & ITP, per-problem oracle & yes & 40/45 & 2611\\
3 & similarity, $e^{-|z|}$, bracket scale, both guards & no & 40/45 & 2733\\
5 & ITP, recommended constants & yes & 40/45 & 2857\\
6 & bisection & no & 40/45 & 3090\\
10 & \textbf{proposed: ratio, 3-point, projection} & \textbf{no} & 40/45 & \textbf{3220}\\
127 & TOMS\,748 & yes & 40/45 & 4000\\
189 & Brent & yes & 38/45 & 4101\\
\bottomrule
\end{tabular}
\end{table}
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. The proposed configuration is tenth by total and
beats Brent $30/4/4$ and TOMS\,748 $31/1/8$, while losing to ITP $17/0/23$ and
to the ITP oracle $16/0/24$.
\subsection{What the guarantee costs}
Nothing on one set, and less than nothing on the other. Against the identical
rule with no safeguard at all:
\begin{center}
\begin{tabular}{lrrr}
\toprule
& solved & total evals & runs over the $2\times$ bound\\
\midrule
APS, no safeguard & 153/154 & 2806 & 0\\
APS, projection & 153/154 & 2806 & 0\\
Chandrupatla, no safeguard & 35/45 & 4104 & 10\\
Chandrupatla, projection & \textbf{40/45} & \textbf{3220} & \textbf{0}\\
\bottomrule
\end{tabular}
\end{center}
On the canonical set the projection never binds and the totals are identical to
the last evaluation. On the wide-bracket set it solves five more problems for
$21\%$ fewer evaluations. This is the opposite of the usual trade, and it is
the point of projecting rather than replacing: the two safeguards that replace
cost $7260$ and $7239$ on Alefeld--Potra--Shi, against $2806$.
\subsection{Wall-clock time, and why it is not the cost model}
Evaluations of $f$ are the cost model because in any real problem $f$ is the
expensive part. Wall-clock time measures something narrower --- the method's
own arithmetic per step --- and it is implementation- and language-bound. We
report it because a reader will ask, and because what it shows is instructive.
On the $199$ problems as they stand, every $f$ being a formula of a few
operations, the proposed rule is the \emph{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.
That inversion is the point. Making $f$ progressively more expensive by a
controlled amount of arithmetic and timing the sweep directly --- nothing
subtracted, nothing modelled --- the proposed rule overtakes ITP once one call
to $f$ costs about $9\,\mu$s and Brent at about $20\,\mu$s, of the order of a
hundred arithmetic operations on this machine. Below that the ranking is
decided by per-step overhead; above it, by evaluations.
Three caveats, all limitations of the measurement rather than of the methods.
Timings vary by tens of percent between runs even on an idle machine. An
attempt to separate our per-step cost into ``algorithm'' and ``Python call
overhead'', by timing a flattened rewrite of the same rule, produced a variant
that diverged from the original on $42$ of the $199$ problems and was
discarded rather than quoted; the question stays open. And an earlier version
of this measurement estimated a per-evaluation overhead by subtracting the
measured cost of $f$, which returned \emph{negative} overheads for four of six
methods --- an impossibility that condemned the estimator, and the reason
nothing is subtracted here.
\subsection{The law across the whole grid}
\label{sec:grid}
Corollaries~\ref{cor:chosen}--\ref{cor:derived} predict an ordering of the nine
similarity functions and of the four scales. Table~\ref{tab:grid} 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.
\begin{table}[h]
\centering
\caption{Mean total evaluations over both sets, step guard, grouped by the
slope $c$ of $1-S$ at the origin.}
\label{tab:grid}
\begin{tabular}{lrr}
\toprule
scale & $c=1$ (linear approach) & $c=0$ (quadratic approach)\\
\midrule
3-point derived & \textbf{6809} & 22294\\
2-point derived & 6906 & 22167\\
bracket & 10263 & 19137\\
start (chosen) & 16102 & 15345\\
\bottomrule
\end{tabular}
\end{table}
Ranked individually and best over scales, the similarities come out $1-|z|$
($6496$), $e^{-|z|}$ ($6822$), $1/(1+|z|)$ ($7038$), $(1+|z|)^{-2}$ ($9502$),
$1-\sqrt{|z|}$ ($10497$), $1-|z|^{1/3}$ ($11941$), $e^{-z^2}$ ($14314$),
$1/(1+z^2)$ ($15102$), $1/\sqrt{1+z^2}$ ($16394$); the scales come out 3-point
($6496$), 2-point ($6628$), bracket ($9081$), start ($14540$). Both orderings
are those the law predicts, and both were predicted before the grid was run.
\section{Where the evaluations go}
Splitting each run at the geometric mean of the initial width and the
attainable tolerance --- the log-midpoint of the journey, at which bisection by
construction has spent half its evaluations --- separates the \emph{approach}
from the \emph{endgame}. On Alefeld--Potra--Shi the two-point rule spends
$2235$ on the approach and $668$ on the endgame against Brent's $2175$ and
$515$: its deficit is almost entirely the endgame, i.e.\ the order, which is
what motivated the three-point scale. On Chandrupatla it spends $1068$ and
$1161$ against Brent's $1343$ and $1358$, winning both phases.
Two natural explanations of the Chandrupatla advantage were tested and
\emph{refuted}. Brent discards $53.3\%$ of its interpolations to its safeguard
on the set it wins and only $34.0\%$ on the set it loses, so safeguard rate is
not the mechanism; and on Chandrupatla Brent is the bolder of the two ---
$56.3\%$ of its probes land in the outer tenths of the bracket against our
$41.8\%$ --- so step length is not the mechanism either.
The mechanism is step \emph{quality}. Reconstructing each method's bracket from
the signs it observed, the median probe removes $0.500$ of the bracket for
every method on Alefeld--Potra--Shi, 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. The similarity rule makes the weakest available assumption
--- a single local slope --- and degrades gracefully.
\section{Negative results}
\begin{enumerate}
\item \textbf{The prototype-aggregation form of the method loses.} A richer
construction --- prototypes over \emph{pairs} of evaluated points, softmax
weights over the whole memory, similarity on both the value and the abscissa
axis --- leads on eight hand-picked problems but loses decisively on the real
set: $0$ wins, $6$ ties and $147$ losses against Brent. The simplest form of
the idea won.
\item \textbf{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. Only projection preserves both. We record this because it
is the trap the construction naturally falls into.
\item \textbf{Zero slack in the projection is degenerate.} A worst case of
exactly bisection demands a halving at every step and leaves the projection no
freedom at all.
\item \textbf{Regimes exist, at the level of a function family, and cannot be
exploited by a switch.} The cube-root similarity beats the proposed rule on
all five members of Chandrupatla's \texttt{fun4} --- $32/32/40/47/59$ against
$89/93/113/125/153$, a factor of $2.6$ --- and consistency across a family at
different parameters is the signature of structure rather than luck. But the
same similarity over the whole Chandrupatla set costs $4099$ against $3220$,
so a switch chosen per benchmark is worse than no switch at all: $6905$
against $6026$ over both sets. The scale axis offers only $5.3\%$ headroom
even to an oracle handed the best scale per problem, two thirds of it inside a
single family, and the winners are not separated by anything the method can
see before it commits --- the proposed scale wins on bracket widths from
$10^0$ to $10^{12}$.
\item \textbf{The phase detector: derivation sound, estimator not.} Redoing
the contraction law without the assumption $|f|\approx|f'(r)|e$ --- taking
$|f|\approx K e^m$ instead --- produces the march exponent on its own,
$p = L/(L-\ln m)$ with $L=\ln(e/D)$, giving $p=1$ at a simple root and dropping
to $0.50$ and $0.23$ as the approach flattens, which is the neighbourhood of
the cube root that wins those families. Substituted back it collapses to the
multiplier $m$, measurable as $m = 1/(1-\theta)$ with $\theta = f f''/(f')^2$
from three divided differences and no constant. It preserves the order
($2.001$) and improves the eight standard problems ($82$ against $84$) --- and
loses on the full benchmark, $6304$ against $6026$. The estimator is the
failure: on Alefeld--Potra--Shi, where almost every root is simple and the
truth is $m=1$, it reports $m>1$ on $27.9\%$ of steps with excursions to
$m=34.8$, against $35.8\%$ on the flat families. $27.9$ against $35.8$ is no
separation. 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$.
\item \textbf{One problem defeats every method}, \texttt{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
machine zero at distance up to $0.086$ from the root.
\item \textbf{The symmetric ratio similarity degenerates.} For
$S(x,y)=\min(|x|,|y|)/\max(|x|,|y|)$ with $y$ the target $0$, $S\equiv0$; the
only usable reading is $1-|f|/\sigma$, which saturates and stagnates
(Table~\ref{tab:law-check}, last row).
\end{enumerate}
\section{Conclusion}
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 their ranking 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 \emph{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 resulting rule has no tuning 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 --- $2806$ evaluations against $2820$ is a margin of $0.5\%$ and
should be read as a tie --- and ahead of Brent by $2.9\%$, which it also beats
$102$ problems to $40$ head to head. The claim the measurements support is
parity with methods that carry tuned constants, not superiority over them.
This is the same movement as in parameter-free similarity control~\cite{sim},
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.
\subsection*{Future work}
One weakness has a clear diagnosis and no fix inside this framework. On
brackets many orders of magnitude wider than the distance to the root, the
search must cross those decades, and an \emph{additive} step of $|f|/|f'|$ is
sized by the local slope, which knows nothing about how many decades remain.
That is why the cube-root similarity, whose step is a fixed \emph{fraction} of
the bracket, beats the proposed rule $2.6$-fold on those families, and why ITP
keeps its lead on the Chandrupatla set.
The regime is therefore multiplicative versus additive movement, not one
similarity function versus another --- a change of the space the method works
in, not of a coefficient inside it. The natural instrument is a logarithmic
change of variable, $u = \operatorname{sign}(x-c)\log(1+|x-c|/s)$, in which an
additive step becomes a geometric march and the exponent that the cube root
fixes at $1/3$ by accident disappears as a free quantity. Two conditions
decide whether that is a method or another refuted idea: the origin $c$ and
unit $s$ must be read from the bracket rather than chosen, and the transform
must be the identity to within rounding on narrow brackets, so that the
wide-bracket families are not bought at the price of the canonical set. Every
attempt reported in Section~7 failed on exactly that second condition.
\begin{thebibliography}{9}
\bibitem{aps} G.~E. Alefeld, F.~A. Potra and Y.~Shi, ``Algorithm 748: Enclosing
zeros of continuous functions,'' \emph{ACM Trans.\ Math.\ Softw.}, vol.~21,
no.~3, pp.~327--344, 1995.
\bibitem{brent} R.~P. Brent, \emph{Algorithms for Minimization without
Derivatives}. Englewood Cliffs, NJ: Prentice-Hall, 1973.
\bibitem{chandrupatla} T.~R. Chandrupatla, ``A new hybrid quadratic/bisection
algorithm for finding the zero of a nonlinear function without using
derivatives,'' \emph{Adv.\ Eng.\ Software}, vol.~28, no.~3, pp.~145--149, 1997.
\bibitem{itp} I.~F.~D. Oliveira and R.~H.~C. Takahashi, ``An enhancement of the
bisection method average performance preserving minmax optimality,''
\emph{ACM Trans.\ Math.\ Softw.}, vol.~47, no.~1, pp.~1--24, 2021.
\bibitem{ridders} C.~Ridders, ``A new algorithm for computing a single root of
a real continuous function,'' \emph{IEEE Trans.\ Circuits Syst.}, vol.~26,
no.~11, pp.~979--980, 1979.
\bibitem{sim} V.~Sitnikov, ``Parameter-free similarity control,'' preprint,
2026.
\bibitem{dowell} M.~Dowell and P.~Jarratt, ``A modified regula falsi method for
computing the root of an equation,'' \emph{BIT}, vol.~11, pp.~168--174, 1971.
\end{thebibliography}
\end{document}