PREREG_flat_exp_limit outcome: ACCEPTED (server numbers equal to the smoke in every projection cell; 0 violations in the guaranteed family).
Translation limit of the analogy (f shrank, x-scale did not -> m = inf): defect + remembered + point + exp APS 2531 CHA 1972 both 4503 G2 + defect + remembered + point + exp APS 2588 CHA 1997 both 4585 G2 + contra + remembered + point + exp APS 2773 CHA 2073 both 4846 Chandrupatla APS 2787 CHA 2441 both 5228 Per problem against Chandrupatla now SIGNIFICANT ON BOTH SETS: G2+contra+rem+pt+exp APS 98/18/37 p=1.5e-7, CHA 28/3/9 p=0.0026; defect+rem+pt+exp APS 86/20/47 p=9e-4, CHA 27/3/10 p=0.0076. NOT where predicted: fun9 only -1..-3; the gain is on the flat families (x^9 177 -> 161, x^19 339 -> 167). Server regression x2: 1179 passed, 1 failed = the paper-number check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -381,3 +381,46 @@ def test_the_order_point_spares_simple_roots_and_beats_the_midpoint_on_powers():
|
||||
_x, nmid, _ = pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
|
||||
guard="project", prestep="flatanalogmem")
|
||||
assert ok and npt < nmid, (npt, nmid)
|
||||
|
||||
|
||||
# ---- PREREG_flat_exp_limit_2026-09-21: translation similarity, m = inf ----
|
||||
@pytest.mark.parametrize("bad", ("exp", "defect+exp", "contra+exp"))
|
||||
def test_exp_needs_the_flat_regime(bad):
|
||||
with pytest.raises(ValueError):
|
||||
pure_root(lambda t: t - 1.0, 0.0, 3.0, XTOL, MAXFEV, similarity="ratio",
|
||||
scale="derived3", guard="project", prestep=bad)
|
||||
|
||||
|
||||
def test_a_translated_exponential_pair_reads_an_infinite_order():
|
||||
e = math.exp
|
||||
old = _config3(3.0, e(3.0), 4.0, e(4.0), 5.0, e(5.0))
|
||||
new = _config3(1.0, e(1.0), 2.0, e(2.0), 3.0, e(3.0)) # the same shape, moved by 2
|
||||
assert new[0] == pytest.approx(old[0]) and new[1] == pytest.approx(old[1])
|
||||
assert _analogy_order(new, [old]) is None # scaling reading: undefined
|
||||
assert _analogy_order(new, [old], translation=True) == math.inf
|
||||
p = lambda t: t ** 5 # noqa: E731
|
||||
a = _config3(0.4, p(0.4), 0.8, p(0.8), 1.6, p(1.6))
|
||||
b = _config3(0.1, p(0.1), 0.2, p(0.2), 0.4, p(0.4))
|
||||
assert _analogy_order(b, [a], translation=True) == pytest.approx(5.0, rel=1e-9)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("f,a,b", PROBS)
|
||||
@pytest.mark.parametrize("guard", ("project", "credit"))
|
||||
@pytest.mark.parametrize("pre", ("flatanalogpt+exp", "defect+flatanalogmempt+exp",
|
||||
"contra+flatanalogmempt+exp"))
|
||||
def test_the_guarantee_holds_with_the_exp_limit(f, a, b, guard, pre):
|
||||
x, n, ok = pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
|
||||
guard=guard, prestep=pre)
|
||||
assert ok and min(a, b) <= x <= max(a, b)
|
||||
half = math.ceil(math.log2(abs(b - a) / XTOL))
|
||||
assert n <= (2 * half + 3 if guard == "project" else half + 4), n
|
||||
|
||||
|
||||
def test_the_exp_limit_leaves_simple_roots_alone():
|
||||
for f, a, b in ((lambda t: 3.0 * t - 1.0, -2.0, 5.0),
|
||||
(lambda t: t ** 3 - 2.0 * t - 5.0, 1.0, 4.0),
|
||||
(lambda t: math.exp(t) - 2.0, 0.0, 3.0)):
|
||||
n = [pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
|
||||
guard="project", prestep=p)[1]
|
||||
for p in ("defect+flatanalogmempt", "defect+flatanalogmempt+exp")]
|
||||
assert n[0] == n[1], n
|
||||
|
||||
Reference in New Issue
Block a user