Repository navigation
Commit e059bc0
y^2 - 2, x^2 + (P - Q y) x - 3, with (1 + sqrt(2))^70 = P + Q sqrt(2), was
answered with the one row [-2P, -sqrt(2)], which leaves -2 in the second
equation, and its four solutions were lost.
The cause is the zero tolerance of a single equation's solve. It runs with
PrecisionErrorZeroRange at 1e-12, so P - Q sqrt(2) = 1.6e-27 is dropped as a
coefficient at y = sqrt(2) (roots +-sqrt(3)), and at y = -sqrt(2) the
discriminant and the small root are rounded away (the one root -2P). Without
that override the system is answered with four correct rows for n = 20..60;
at n >= 70 the default downcasting, 1e-50, still reads b^2 + 12 as 12. That
is downcasting itself, which v3 removes (#1019), and is left alone here.
The wrong row got through RowsThatHold because its residual is exact and
algebraic, and StatementSolver.IsEvidenceAgainst accepts such a residual up
to 1e-50 of the largest term: -2 against terms of 4e53 passed. A row with
only exact numbers is a solution only where each residual is exactly zero,
so an interval from PreciseEvaluation that leaves out zero proves it is
none. Such a row now declines the system rather than being dropped: that
the tolerance accepted it means rounding reached the elimination, which
lost true rows here too, and dropping it would answer an incomplete set.
The interval is taken to the working precision in decimal places, with a
second evaluation where the terms are large (n = 140 has terms near 1e107).
An enclosure that holds zero, or cannot be computed, changes nothing, so no
true row can be lost by the check.
Measured, master -> branch, rows checked at 150 digits with mpmath:
n = 5, 10 four correct rows -> unchanged
n = 20..60 declined -> declined
n = 70..120, 160 one wrong row [-2P, -sqrt(2)] -> declined
n = 140, 200 three wrong rows -> declined
System-solver filter 108 passed, 2 s before and after; Regression 411,
EquationSolving|SolveTest 192, Algebra|Corpus|Solv 2235, PublicApiSurface 1.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f439c0e commit e059bc0
3 files changed
Lines changed: 136 additions & 0 deletions
File tree
- Sources
- AngouriMath/Functions/Continuous/Solvers
- Tests/UnitTests/Common
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
66 | 84 | | |
67 | 85 | | |
68 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
291 | 306 | | |
292 | 307 | | |
293 | 308 | | |
| |||
305 | 320 | | |
306 | 321 | | |
307 | 322 | | |
| 323 | + | |
| 324 | + | |
308 | 325 | | |
309 | 326 | | |
310 | 327 | | |
311 | 328 | | |
312 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
313 | 383 | | |
314 | 384 | | |
315 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
286 | 334 | | |
287 | 335 | | |
288 | 336 | | |
| |||
0 commit comments