Skip to content

Cancel the logarithms of the moduli of polynomials at -oo (#2633) - #2640

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
neg-infinity-logs-2633
Nov 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
neg-infinity-logs-2633

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

At -oo a factor such as x + 1 is negative. The real-logarithm rewrite (#2616) takes its logarithm in the antiderivative of its modulus, ln|x + 1|. The degree split before the limit at an infinite bound (#2626) read only polynomials and declined on the modulus. So 1/(x^5+1) over (-oo, -2] was left unevaluated, although its mirror over [2, +oo) is answered.

ln|a| = d ln|x| + ln(|a| / |x|^d) holds for every real x but 0, so the modulus of a polynomial now has that polynomial's degree. That is a seven-line change.

simplified master / 2.10.0 this branch mpmath
integral(1/(x^5+1), x, -oo, -2) unevaluated (8 s) closed form -0.0158464764791928627…
integral(x/(x^5+1), x, -oo, -2) unevaluated closed form 0.0421645551880158608…
integral(1/(x^5+1), x, -oo, +oo) unevaluated NaN diverges at the pole x = -1

The last row is NaN because the pieces on either side of the pole are -oo (over (-oo, -1]) and +oo (over [-1, 0]). That is the library's reading of 1/x over [-1, 1] too: no value.

Checks

  • Integral lists diffed against master: 205 definite integrals, with the last row above as the only change.
  • Random sweep: 140 rational integrands of degree 3–7 with sign-varied coefficients over infinite ranges, checked against mpmath quad at 50 digits. It found no wrong value on master or on this branch. Its 91 refusals are unchanged: almost all are sums over roots, at -oo, or beside a separate logarithm. They are a separate mechanism, listed in the report.
  • New test: fails 2 of 3 cases on master.
  • Full UnitTests suite (net10.0, on master a3b3d25 + this): 21799 passed, 0 failed, 13 skipped.
  • Build: the library builds with 0 errors for every target framework.

Closes #2633.

🤖 Generated with Claude Code

At -oo a factor such as x + 1 is negative. The real-logarithm rewrite
(#2616) therefore takes its logarithm in the antiderivative as
ln|x + 1|. The degree split before the limit at an infinite bound (#2626)
reads only polynomials, so it declined, and 1/(x^5 + 1) over (-oo, -2]
was left unevaluated while its mirror over [2, +oo) was answered.

ln|a| = d ln|x| + ln(|a| / |x|^d) holds for every real x but 0, just as
ln(a) does for a positive. The modulus of a polynomial now has that
polynomial's degree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.69%. Comparing base (a3b3d25) to head (8753e41).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2640      +/-   ##
==========================================
- Coverage   86.70%   86.69%   -0.01%     
==========================================
  Files         345      345              
  Lines       75428    75543     +115     
  Branches    22034    22076      +42     
==========================================
+ Hits        65397    65494      +97     
- Misses       5418     5426       +8     
- Partials     4613     4623      +10     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.19% <100.00%> (-0.01%) ⬇️
fsharp 32.79% <ø> (ø)
interactive 40.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/Continuous/Integration/Integration.Definition.cs 86.68% <100.00%> (-1.08%) ⬇️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit 344f8f8 into master Nov 29, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 29, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the neg-infinity-logs-2633 branch November 29, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

A rational integral down to -oo is left unevaluated where its mirror up to +oo is answered: integral(1/(x^5+1), x, -oo, -2)

1 participant