Repository navigation
arctan and arccot are undefined at their poles - #2304
Merged
Rafael-SOWNet merged 1 commit intoOct 31, 2026
Merged
Conversation
arctan(z) is (i/2)(ln(1 - iz) - ln(1 + iz)), with poles where 1 + z^2 = 0, at i and -i, where it evaluates to an infinity as ln(0) does. arccot(z) is arctan(1/z) and has the same two. Both conditions said True, so arctan(x) - arctan(x) simplified to 0, which has a value at i. They are now not 1 + x^2 = 0, as the tangent's excludes its own poles. The linear-over-quadratic integral wrote its arctangent part even when the numerator was a multiple of the denominator's derivative and left no constant for it, 0 * arctan(2x/2). With the poles in arctan's condition that zero kept them, and x/(x^2 + 1) was answered with provided not 1 + (2x/2)^2 = 0 beside a logarithm that has no value there either: ten tests, through the substitution u = tan(c + dx) as well. It now leaves the part out, as the higher powers of the quadratic already did. An antiderivative that keeps an arctangent can list its poles among the points it has no value at. They say nothing new, and the redundant-condition step cannot see that, since Simplify spells the condition and the arctangent's argument differently. x^2 coth(a + 2 ln(x))^2 is the one test that notices: 1,128 characters of raw answer went to 1,382, against a bound of 1,300 meant to catch the 3,577 of a split on a symbol's sign, so the bound is 1,400. ArctangentPolesTest checks the condition at both poles and off them, and that the two differences have no value at i. The suite, the trio, F#, AOT and the eight harnesses pass. Fixes #2256. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2304 +/- ##
==========================================
+ Coverage 86.74% 86.77% +0.03%
==========================================
Files 310 310
Lines 67973 67974 +1
Branches 19744 19737 -7
==========================================
+ Hits 58961 58985 +24
+ Misses 4880 4868 -12
+ Partials 4132 4121 -11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
arctan-and-arccot-are-undefined-at-their-poles
branch
October 31, 2026 21:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
arctanandarccothave poles atiand-i, where they evaluate to an infinity, asln(0)does. Their condition is nownot 1 + x^2 = 0, as the tangent's excludes its poles.arctan(x) - arctan(x)simplified0, which has a value ati0 provided not 1 + x ^ 2 = 0arccot(x) - arccot(x)simplified00 provided not 1 + x ^ 2 = 0arctan(x).DomainConditionTruenot 1 + x ^ 2 = 0provided. Nine of them came from one place. The linear-over-quadratic integral wrote0 * arctan(2x/2)when the numerator was a multiple of the derivative, and that zero kept the poles:x/(x^2 + 1)was answered withprovided not 1 + (2x/2)^2 = 0. It now leaves the part out, as the higher powers of the quadratic already did.Simplifyspells the condition and the argument differently, so the redundant-condition step can't see that. Its raw answer went from 1,128 characters to 1,382, against a bound of 1,300 that was meant to catch a 3,577-character split, so the bound is now 1,400.ArctangentPolesTest's 11 cases fail on master. The suite, the trio, F#, AOT and the eight harnesses pass.Fixes #2256, whose other four items landed in #2260, #2261, #2262 and #2263.
🤖 Generated with Claude Code