Skip to content

Commit 8c46d55

Browse files
Learn modulo a prime whether the elimination over the rationals declines (#2007)
TrySolveOverPolynomials' reading and Bareiss elimination now run first on the system's image modulo 2^31 - 1: the same readings, pivots, products and exact divisions, in residues that cost a machine multiplication where a minor's rationals cost a greatest common divisor. The intermediates are minors, so each image has no monomial the rational one lacks, and a product past the term bound, an exponent past the degree bound, a refused entry or a row reducing to 0 = c there is one over Q too. The solve over Q is then declined at once. Anything else says nothing, and the solve runs as before; nothing is answered on the strength of the images. The Hermite reductions of Rubi's 1/(a + b cosh(x) + c sinh(x))^n under u = e^x are twenty-row systems whose minors pass four thousand terms by the sixth pivot, and they spent seconds each before declining. Pocket of 1,951 rows: verdicts identical, 1,889 solved on both. Over the 1,886 solved on both, allocation 654 -> 429 GB, time 812 -> 733 s; 6.7.1:866 21.6 s -> 3.4 s (57.7 -> 1.3 GB), 880 16.0 s -> 1.6 s. Samples of every family unchanged. The five rows that moved, re-run alone: 6.7.1:921 and 929 timeout -> 2.0 s and 2.8 s; the other three identical in allocation. No row's allocation grew past 1.3x. Part of #233. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent a4e7656 commit 8c46d55

3 files changed

Lines changed: 849 additions & 1 deletion

File tree

‎Sources/AngouriMath/Functions/Algebra/Polynomials/MultivariatePolynomial.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ private static void Accumulate(Dictionary<ulong, ERational> into, ulong monomial
225225
return result;
226226
}
227227

228+
/// <summary>The packed monomial of <paramref name="variable"/> to the first power.</summary>
229+
internal static ulong MonomialOf(int variable) => Pack(variable, 1);
230+
228231
internal MultivariatePolynomial ScaleBy(ERational factor)
229232
{
230233
if (factor.IsZero)

0 commit comments

Comments
 (0)