Repository navigation
Commit 29af2fd
A rational integral over the roots of its denominator (#1637)
The Rothstein-Trager resultant declined a rational function whose residues lie in a field of degree
above two: 1/(x^3 + x + 1) and #1285's sqrt(x)/(1 + x + x^4), 2u^2/(1 + u^2 + u^8) under
u = sqrt(x), were left unevaluated. Their logarithms are written now as a sum over the roots of the
factor of the denominator they belong to, sum(A(r)/D'(r) ln(x - r), r in { r : E(r) = 0 }), the
form #1285 asked for, with the node #1624 added. The poles whose residues are roots of R are the
common roots of D and D'^n R(A/D'), so E is their gcd over the rationals, and no arithmetic in the
residues' field is needed.
Only as a last resort. Asked beside the other rules, the sum answered each of Jeffrey's three terms
of (-1 + 4 cos(x) + 5 cos(x)^2)/(-1 - 4 cos(x) - 3 cos(x)^2 + 4 cos(x)^3) with a sum over the roots
of a sextic, where the whole is 2 arctan(tan(x/2)^3 - 2 tan(x/2)). So the rule declines as before
and notes that a sum would answer, and only where the question comes back unanswered and that was
noted is it asked again with sums allowed, under a memo of its own; the answer found then is
remembered for the question.
The integrator checks an answer in double intervals and then in decimals, and neither read the sum
node, so every such answer would have been declined by its own check. PreciseEvaluation encloses
each root now: Durand-Kerner's approximations, each widened by its Weierstrass correction in
intervals, n |w_k| about z_k, which holds exactly one root where the rectangles are apart
(Braess and Hadeler), and the summand worked out on each rectangle.
Measured on the Rubi corpus, master at ad05a79 and this change on it, run side by side: the
independent suites 1753 -> 1756 of 1814 (Bondarenko 22 and 23, and Hearn 66, 1/(1 - x^4 + x^8));
family 1 at ten problems a file, 295 -> 301 of 377 (1/(x^2 (1 - x^3 + x^6)), (1 + x^4)/(1 - x^4 +
x^8), (1 + x^4)/(1 - 5x^4 + x^8), (-1 + 2x^4 + sqrt(3))/(1 - x^4 + x^8), (1 - x^4)/(1 - x^4 + x^8)
and x^3 (5 + x + 3x^2 + 2x^3)/(2 + x + 5x^2 + x^3 + 2x^4)); families 2 to 7 at the usual sample, 663
of 722 on both. 0 wrong everywhere. Run alone, those nine are 0 of 9 on master and 9 of 9 here, and
the tenth problem that moved, 1.1.4.3 #231, is 17.9 s unevaluated on both: its master timeout was
the load of the side-by-side run. A question still declined costs what it did: the problems
unevaluated in both arms took 14.2 s against 13.4 s in the independent suites, 65.6 s against 64.7 s
in families 2 to 7 and 89.9 s against 92.3 s in the family 1 sample.
The performance gate passes on 34c548a8, whose library code is this commit's: allocation is what
the baseline says on all 19 gated benchmarks.
RothsteinTragerTest: the cubic, quartic and quintic rows that were pinned as declined are sums now,
and #1285's integral in PowerSubstitutionIntegralTest; that test's declined witnesses are the
elliptic x^2/sqrt(x^4 + x + 1) and x^2/sqrt(x^4 + x^3 + 1), which nothing answers.
BinomialDenominatorIntegralTest, PartialFractionsTest and RationalIntegralsTest pinned
1/(x^3 + x + 1), 1/(x^3 + x^2 + x + 2), 1/(x^4 + x + 1) and 1/(x^4 + x^3 + 1) as declined: each is
the sum now, checked by differentiating back, and the boundary pinned in their place is the same
kind of denominator with a symbol among its coefficients, which the sum is not written for.
DecliningStaysCheap keeps its ten-second bound as FindingThatNothingSplitsStaysCheap: the second
pass starts only once the first has declined, so the decline it guards is still inside the bound.
Closes #1285.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent ad05a79 commit 29af2fd
9 files changed
Lines changed: 329 additions & 66 deletions
File tree
- Sources
- AngouriMath
- Functions/Continuous/Integration
- Numerics
- Tests/UnitTests/Calculus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1699 | 1699 | | |
1700 | 1700 | | |
1701 | 1701 | | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1702 | 1727 | | |
1703 | 1728 | | |
1704 | 1729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
450 | 469 | | |
451 | | - | |
452 | | - | |
| 470 | + | |
453 | 471 | | |
454 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
455 | 483 | | |
456 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
457 | 497 | | |
458 | 498 | | |
459 | 499 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
68 | | - | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | | - | |
159 | | - | |
| 161 | + | |
160 | 162 | | |
161 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
162 | 189 | | |
163 | 190 | | |
164 | | - | |
| 191 | + | |
165 | 192 | | |
166 | | - | |
167 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
168 | 201 | | |
169 | 202 | | |
170 | 203 | | |
| |||
181 | 214 | | |
182 | 215 | | |
183 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
184 | 253 | | |
185 | 254 | | |
186 | 255 | | |
| |||
0 commit comments