Skip to content

Commit 9c3dce4

Browse files
A root check says what it tolerates: zero to about fifty digits (#2163)
GroebnerSystemSolver.Satisfies said that "no tolerance is involved anywhere, which is what would turn a root that is merely close into one that gets reported". It decides with InnerSimplified, and with downcasting on, the default, a residual that evaluates below DowncastingTolerance (half the hundred working digits) times the scale that cancelled comes out as 0. Measured on 583338e: 8y^3 + 4y^2 - 4y - 1 at the Cardano root for cos(2pi/7), with one 7 made 7 + 10^(-50), is 0 to InnerSimplified, while mpmath at 200 digits gives 2.48e-52 - 3.26e-52 i. With 10^(-40) it is left unsimplified, and evaluates to 2.48e-42 - 3.26e-42 i. So a candidate right to about fifty digits is accepted. The comment says so, and "proves" becomes "settles" where the same paragraph names what it reduces to zero. No behaviour changes. Found answering #2143 Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b043d06 commit 9c3dce4

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎Sources/AngouriMath/Functions/Algebra/Groebner/GroebnerSystemSolver.cs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,21 @@ static Entity Canonical(Entity substituted, IReadOnlyDictionary<Variable, int> r
249249
/// radical is not bounded by anything, and an early version of this spent longer
250250
/// failing to prove a degree-nine root satisfied its system than the old solver takes
251251
/// to solve the whole thing. `InnerSimplified` is one structural pass, which is
252-
/// cheap enough to be safe here and still proves what is needed:
252+
/// cheap enough to be safe here and still settles what is needed:
253253
/// <c>sqrt(2)^2 - 2</c>, <c>(3^(1/3))^3 - 3</c> and a Cardano cube root all reduce to
254254
/// zero in single-digit milliseconds.
255255
/// </para>
256256
/// <para>
257-
/// It only ever proves zero, never disproves it, so a candidate it cannot settle is
258-
/// declined and the system falls back. That costs coverage and never costs
259-
/// correctness — and no tolerance is involved anywhere, which is what would turn a
260-
/// root that is merely close into one that gets reported.
257+
/// It only ever answers zero, never disproves it, so a candidate it cannot settle is
258+
/// declined and the system falls back, which costs coverage. The zero is decided to
259+
/// about fifty digits, though, not exactly. With downcasting on, the default, a
260+
/// residual that evaluates below <c>DowncastingTolerance</c>, half the hundred digits
261+
/// of <see cref="MathS.Settings.DecimalPrecisionContext"/>, times the scale that
262+
/// cancelled is taken as <c>0</c>. So a candidate that is close enough passes as
263+
/// well: <c>8y^3 + 4y^2 - 4y - 1</c> at the Cardano root for <c>cos(2pi/7)</c>, with
264+
/// one <c>7</c> made <c>7 + 10^(-50)</c>, comes out <c>0</c>, where its value is
265+
/// <c>2.48e-52 - 3.26e-52 i</c>.
266+
/// <a href="https://github.com/asc-community/AngouriMath/issues/2143">#2143</a>
261267
/// </para>
262268
/// </remarks>
263269
static bool Satisfies(

0 commit comments

Comments
 (0)