Valeri's objection measured: the principle is right (a similarity step should be large far away and small near), and our sigma = |f'|D defeats it — at x=1e4 on a 2e4 bracket the normalised residual is 0.167, so S=0.833 'similar' and the step is small five thousand step-lengths from the root. Selecting sigma = min(|f'|D, max|f| at the ends) — no new constant — improves 403 to 390 on eight hand-picked wide problems but is WORSE over the grid: APS 3288 vs 2726, CHA 3111 vs 2683, so the mode is rejected by its pre-registered rule. Its extra solves are two fun7 problems landing inside the flat zero region, i.e. the scoring artefact and not a capability. Written into Negative results as the answer to the natural objection

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-21 00:19:03 +01:00
co-authored by Claude Opus 5
parent 08ffa42e98
commit cc2c499f63
8 changed files with 167 additions and 6 deletions
+17 -3
View File
@@ -505,7 +505,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
if similarity not in PURE_SIMS:
raise ValueError(f"unknown similarity {similarity!r}")
if scale not in ("derived", "derived3", "derived_rho", "derived3_rho",
"derived3_m", "start", "bracket"):
"derived3_m", "derived3_cap", "start", "bracket"):
raise ValueError(f"unknown scale {scale!r}")
if space not in SPACES:
raise ValueError(f"unknown space {space!r}")
@@ -515,11 +515,12 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
raise ValueError(f"unknown points rule {points!r}")
if direction not in DIRECTIONS:
raise ValueError(f"unknown direction {direction!r}")
if points == "shape" and scale not in ("derived3", "derived3_rho", "derived3_m"):
if points == "shape" and scale not in ("derived3", "derived3_rho", "derived3_m",
"derived3_cap"):
# the triple only exists for the three-point scale; selecting one under a
# two-point scale would change nothing and hide that
raise ValueError("points='shape' requires a three-point scale (derived3*)")
if prestep == "slope" and scale not in ("derived", "derived3"):
if prestep == "slope" and scale not in ("derived", "derived3", "derived3_cap"):
# there is no slope to judge under a chosen or bracket scale; judging something
# else would hide that, so the call fails instead
raise ValueError("prestep='slope' requires scale in {'derived', 'derived3'}")
@@ -603,6 +604,19 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
else:
slope = _slope3(x, fx, x_prev, f_prev, x_prev2, f_prev2)
sc = abs(slope) * abs(far - x)
elif scale == "derived3_cap":
# Valeri, 2026-09-21: "if the similarity formed the step, the step would be
# large far from the target and small near it". It does not, and the reason
# is the normalisation: with sigma = |slope| * D the similarity reads "what
# fraction of the BRACKET the Newton step is", not "how far am I". On a
# 2e4-wide bracket of x^3-2x-5 at x = 1e4 that fraction is 0.167, so S =
# 0.833 - "similar" - and the step is small exactly where it should be large.
# The scale is therefore SELECTED between the two already-computed ones:
# far away the value scale of the bracket ends is the smaller and the step
# opens up; near the root the slope scale is the smaller and Newton (and the
# order) returns. A min over what is in hand - no constant, no threshold.
slope = _slope3(x, fx, x_prev, f_prev, x_prev2, f_prev2)
sc = min(abs(slope) * abs(far - x), max(abs(FA), abs(FB)))
if scale == "derived3_m":
# REFUTED as an improvement - kept for reproducibility.
# The DERIVATION holds: dropping the linearity