Repository navigation
Commit 2d7d31e
Simplify does not add a condition the input does not have (#2171)
PolynomialLongDivision divides by the divisor's leading coefficient. Its
first attempt, on the pair as written, declines a symbolic one for the
simplifier, since a quotient that loses a value of a parameter is not an
equivalence. The second attempt, with the variables replaced by
temporaries, had no such guard: it predates it, and #1269 left it as it
was. (t x + y)/(1 - y x) divided there in y is
-1/x + (t x + 1/x)/(1 - x y), undefined at x = 0, where the divisor is 1,
and Simplify answered -(t x + y)/(1 - y x) + (t x + y)/(1 - y x) with
0 provided not 1 - x y = 0 and not x = 0. The input is -y + y at x = 0.
The replaced attempt now declines too where the coefficient is symbolic
and the divisor has more than one term in the variable. A divisor of one
term, a x^k, is zero wherever its coefficient is, so dividing by it loses
nothing the input had, and is still done. Guarding that case as well
changed the limit of (tan(a x) - sin(b x))/(a x) at 0 from (a - b)/a to
1 - b/a, because Simplify does not put 1 - b/a over one denominator
(#2137), so it is not guarded.
On 2.6.0 and on this branch:
-(t*x + y)/(1 - y*x) + (t*x + y)/(1 - y*x)
0 provided not 1 - x * y = 0 and not x = 0 -> 0 provided not 1 - x * y = 0
Unit suite 17,130 passed, 0 failed. SimpSweep 10,463/10,463 agree;
CanonCheck matches its baseline; BoundCheck 0 disagreements; CasBench
120/121, unchanged.
Part of #2134
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent 689fd01 commit 2d7d31e
3 files changed
Lines changed: 59 additions & 0 deletions
File tree
- Sources
- AngouriMath/Functions/TreeAnalyzer
- Tests/UnitTests/Common
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments