Your free trial has ended.

Try the live demo or log in .

9c5490bf

By: ValentinHirschi <valentin.hirschi@gmail.com>

Take the contour box's edge roots from exact Källén functions and end masses

Every quadratic that `box_complex::s3` integrates is the restriction of a
triangle's Feynman polynomial to one of its edges, i.e. the Feynman
polynomial p x² + (far - near - p) x + near of a two-point subgraph: its
discriminant is the Källén function λ(p, near, far) and its values at the
ends of the integration are the masses there. In zero_external,
(c + e)² - 4b(a + dpf) = λ(p1, m1, m2), dpe² - 4(a + b + c)f = λ(p5, m1, m3)
and d² - 4af = λ(p2, m2, m3); `ordered`'s three tfun calls use all six
λ(p_ij, m_i, m_j), and the opposite chart's t13 four of them.

The charts now form λ from the invariants as (p - s+)(p - s-), with
s+ = mi + mj + 2 sqrt(mi mj) and s- = (mi - mj)²/s+ (exactly mi when mj = 0),
and pass it with p and the two end masses down through tfun/tfun_selected/
t1/t13 (`kallen`, `Edge`), as 3cbe08d passed exact coefficient sums. `s3`
decides an exact double root by λ = 0, takes the root separation from
sqrt(λ) and the roots' slopes 2az + b = ±sqrt(λ), whose signs fix their
continuation. The 1024 |b|² collapse of 4d438cf is gone. A massless end is
an exact root 0 or 1, and the other root lies (p - far)/p or (near - p)/p
from it; within an ulp of the pseudo-threshold that root rounds onto the
end, so both continue from the exact end values (first-order term
-db/a - d_end/slope), not from db z + dc, which cancels to rounding there.

Roots that are exactly 0 or 1 because coefficients sum to a vanishing
invariant: besides the massless ends (the binary64 root 1 + 9e-15 of the
s23 = 0 box), the contour line's coefficient sums g + h, g + j and
g + h + j are passed from the invariants (p3 - p5 - p0, m0 - m1 + p1 - p4,
m0 - m1 - p0 in zero_external). With p3 = p5 the rounded g + h was 1e-16
and put the root of one edge at 1e15; one of the two equivalent contours
(conjugate betas, picked by a rounding tie in their distances, already in
4d438cf) then evaluated O(1) wrong in binary64.

Lines 471-474 of tests/data/permutation_regressions.txt were not limited by
their pseudo-threshold (perturbing p3 off m3 kept 7e-10): `ordered`'s charts
have a root beta of b beta² + c beta + a next to 1 because a + b + c, their
s23 = 0.0049, is small beside masses 0.013, and beta_data's d + beta e cancelled
by 800 (the contour poles lost 3.4e-11). beta - 1 now comes from
(beta1 - 1)(beta2 - 1) = (a + b + c)/b, and nearer 1 than 0 the chart
coefficients are expanded about beta = 1 (1 - beta is -w). The remaining
2.6e-10 (hand-written), 6.2e-11 (expression, generated code) and
5.4e-10 (SymJIT, 1.8e-10 before; its tolerance is 1e-7) are an
intrinsic cancellation in the pole polynomial of the chart for these small
invariants; the lines now pass at the normal 5e-10 tolerance and
CONTOUR_BINARY64_LIMITED is removed.

Binary64 (hand-written kernels, generated code, expressions, SymJIT) against
192 to 256 bits:
- p² = (M (1 + r), 81738, -181550, -222558), s12 = -43301, s23 = -155866,
  m² = (M, 0, 100, 100), M = 8315.178393760001, r = ±1e-15 ... ±1e-5 and 0:
  at most 8.2e-15 on every route (was up to 2.8e-7 at r = 5e-7, 1e-9 to
  1e-10 beyond 1e-6);
- the s23 = 0 box in its four cyclic labellings: 8e-14 to 1.6e-12 (was
  2.2e-10 to 2.4e-10);
- sweep boxes within an ulp of a pseudo-threshold: 3e-15.
tests/d0_contour_thresholds.rs checks these and the vanishing line
coefficient on every route.

Tests: full suite with generated evaluators passes (219 passed, 7 ignored). The
hand-written kernel's expression comparison takes the quadratics' discriminant
from re(a) as `s3` does. Native code regenerated (B0's generated code
reorders two sum terms: the new symbols shift Symbolica's term order), D0
SymJIT asset rebuilt.

Oracle sweeps (D0, four seeds, native, generated and expression routes,
against 4d438cf): 84, 116, 72 and 0 rows fixed (native), 104, 104, 72 and 0
(generated), 112, 104, 72 and 24 (expressions), none regressed. B0 (two
seeds, three routes): unchanged.
Retired instructions per call on the recorded NinjaRS streams (Källén
functions in real arithmetic for real masses in the hand-written kernel):
D0 -0.74% (geomean; at most +0.12%, the four-photon box), C0 unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>