Repository navigation
Keep an irrational exponent exact in the power rule - #2393
Merged
Merged
Conversation
The power rule wrote a constant exponent as its evaluated value, so an exponent that is not rational became a decimal: x^pi differentiated to 3.14159... * x^2.14159.... l'Hopital's rule then answered (x^pi - 1) / (x - 1) at 1 with that decimal instead of pi, and x^pi / log(x, 2) - 2 at 0 from the right was left unevaluated, since nothing reads the decimal as pi again. The value is kept where it is rational, and the exponent is written as it is otherwise. Found by limitcheck; no issue was filed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2393 +/- ##
==========================================
- Coverage 86.80% 86.79% -0.02%
==========================================
Files 312 312
Lines 69223 69224 +1
Branches 20186 20186
==========================================
- Hits 60090 60083 -7
- Misses 4917 4925 +8
Partials 4216 4216
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
The power rule wrote a constant exponent as its evaluated value, so an exponent that is not rational became a decimal:
x^pidifferentiated to3.14159... * x^2.14159.... l'Hôpital's rule then answered limits whose value ispiwith a hundred-digit decimal, and limits that needed the decimal read aspiagain were left unevaluated.The value is kept where it is rational, and the exponent is written as it is otherwise.
x^pidifferentiated3.14159... * x ^ 2.14159...pi * x ^ (pi - 1)(x^pi - 1) / (x - 1)at 13.14159...pi(x^sqrt(2) - 1) / ln(x)at 11.41421...sqrt(2)(x^ln(2) - 1) / (x - 1)at 10.69314...ln(2)x^pi / log(x, 2) - 2at 0 from the right-2x^(abs(x)^arctan(2))at 0 from each side1x^(abs(x)^arctan(2))at 0 from the left is 1: the exponentttends to 0 andt ln(x) = t (ln|x| + i pi)tends to 0. Two-sided it stays NaN on every build, which is the convention for a complex branch on one side and is not changed here.x^pi / log(x, 2) - 2now answers, but takes about 12 s, because l'Hôpital's rule differentiates that quotient about ten times. That is a separate defect.The new
ADerivativeKeepsAnIrrationalExponentExactTestfails on master in 7 of its 8 rows; the eighth pins a rational exponent, which is unchanged. Entry in BREAKING-CHANGES.md.Measured
DEPTH=3, across 42 seeds against master: only thex^(abs(x)^arctan(2))rows move, from unevaluated to 1.Found by limitcheck; no issue was filed.
🤖 Generated with Claude Code