3023fa6b

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

Take 1 - x of the few-mass boxes' dilogarithms next to collinear limits

The finite one-mass and two-adjacent-mass boxes (OneLOop's boxf1 and boxf2)
lost precision in binary64 next to a collinear limit, where an invariant
between their two massless lines is small but nonzero: the reported boxes
kept 2.9e-7 (one complex mass, p1² = -6.7e-9), 4.2e-9 (one real mass, p2² =
-1.3e-10) and 1.1e-9 (two adjacent masses, p4² = -4.5e-6) on every route,
and scans of the same boxes were O(1) wrong at 1e-14. OneLOop's double
precision loses the same.

Two cancellations. Where the quadratic's leading coefficient a = r34 r24 is
the small one, the textbook root (b - d)/(2a) lost the small root: the roots
now follow solabc (the larger directly, the other from Vieta's product), as
the triangles and the massless box already did. Otherwise the quadratic
tends to (r34 X - r13)(r24 X - r12) as r23 vanishes, and one argument of
each dilogarithm pair X r34/r13, X r24/r12 approaches one. On sheets with
windings the dilogarithm carries i pi n log(1 - x) there, the collinear
logarithm, and 1 - x formed from the rounded argument lost |1 - x| relative
digits. The quadratic at u = r13/r34 and r12/r24 is r23 times a closed form
(r23 (r14 u - 1) for one mass, r23 (k14 u - u² - 1) for two), so the roots'
offsets from u come from Vieta's product of the shifted quadratic
(triangle::ordered_root_offsets, with the roots' labels), and 1 - x =
-(X - u)/u from them. The new sheet_exact::complement_difference takes these
complements: its dilogarithms use them for log(1 - x) and Li2(1 - x) (-w/x
in the inverted form) and the gap w2 - w1 where the complements are the
smaller; a cancelling difference still takes near_difference from the
values. The Dual neighborhoods keep the plain difference. The r14 terms
and the three-mass box (no two massless lines) are unchanged.

The complements also decide on which side of the unit circle the argument
lies, 1 - |1 - w|² = 2 Re w - |w|², which sheets with two or more windings
jump across.

On 400 random one- and two-adjacent-mass boxes with one invariant between
1e-14 and 1e-3 (real and complex masses), every binary64 route is now
within 1e-12 of OneLOop's quadruple precision but one (4e-12 to 9e-12 by
route, 5e-12 before; the same two-mass box loses as much at an invariant of
1e-2, where OneLOop keeps 4e-13). About 150 were beyond 1e-12 before on
every route, and 67 are in OneLOop's double precision. 128 to 512 bits agree
with quadruple precision to 1e-33, as before. The reported boxes and their
scans to +-1e-14 keep 2e-13 on every route.

New tests: tests/d0_collinear_limits.rs (the reported boxes and their
scans on every binary64 route; three random boxes at 128 to 512 bits
against OneLOop's quadruple precision, which were O(1) wrong at 256 bits
before 95f8107 took the unit-circle test on a real part) and
complement_differences_next_to_one in sheet_exact (binary64 within 1e-15
next to one on winding sheets, where the plain difference of the rounded
arguments was off by 3e-4).

Tests: full suite with generated evaluators passes (229 passed, 7 ignored).
Native code regenerated, D0 SymJIT asset rebuilt. Oracle sweeps (D0, four
seeds, native, generated and expression routes, against 95f8107): no row
fixed or regressed on any route. Retired instructions per D0 and C0 call on
the recorded NinjaRS streams are unchanged against 95f8107 (they contain no
one- or two-adjacent-mass box).

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