| 362 | // expected form does not — Rubi's own test verification is symbolic, |
| 363 | // so it never sees this). Accept as 'solved-formal' when: |
| 364 | // (1) some region matches exactly (≥ MIN_POINTS passing points), and |
| 365 | // (2) every failing point has dF/f UNIMODULAR (pure phase, no |
| 366 | // magnitude error) and LOCALLY CONSTANT (same ratio at x ± δ — |
| 367 | // rejects smoothly-varying ratios from wrong coefficients). |
| 368 | // A globally wrong phase (e.g. e^{iπ/4} everywhere — the old #1711 |
| 369 | // bug class) has no passing region and is still solved-wrong. |
| 370 | if (fails >= 2 && passes >= MIN_POINTS) { |
| 371 | const ratio = (n: C, d: C): C | null => { |
| 372 | const m2 = d.re * d.re + d.im * d.im; |
| 373 | if (m2 < 1e-30) return null; |
| 374 | return { |