Repository navigation
Read a compiled power's constant exponent for its value - #2339
Merged
Merged
Conversation
Both compilers take the real root of a negative real for a rational exponent with an odd denominator below ten, as evaluation does, but only where the exponent was written as a rational. Written otherwise it was the principal power: x^(1/(1 + 2)), x^(3^(-1)) and x^((1/3) provided 2 > 1) compiled to 1 + 1.73i at -8, and NaN over double, where evaluation reads the exponent as 1/3 and is -2. An exponent with no variable is now read for its value, through InnerSimplified, in both compilers. Found by compilesweep at seed 13, on (sin(x))^(1/(3 provided 3 > 1)) at -1.3; no issue was filed. 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 #2339 +/- ##
==========================================
+ Coverage 86.76% 86.77% +0.01%
==========================================
Files 312 312
Lines 68598 68600 +2
Branches 19962 19963 +1
==========================================
+ Hits 59519 59529 +10
+ Misses 4914 4905 -9
- Partials 4165 4166 +1
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.
Both compilers take the real root of a negative real for a rational exponent with an odd denominator below ten, as evaluation does (#2318). They only recognised the exponent when it was written as a rational. Any other spelling compiled to the principal power:
Compile("x").Call(-8)x^(1/3)<1.0000000000000002; 1.7320508075688772><-2; 0><-2; 0>-2x^(1/(1 + 2))<1.0000000000000002; 1.7320508075688772><1.0000000000000002; 1.7320508075688772><-2; 0>-2x^(3^(-1))<1.0000000000000002; 1.7320508075688772><1.0000000000000002; 1.7320508075688772><-2; 0>-2x^((1/3) provided 2 > 1)<1.0000000000000002; 1.7320508075688772><1.0000000000000002; 1.7320508075688772><-2; 0>-2Over
doubleeach of the last three wasNaN.An exponent with no variable is now read for its value through
InnerSimplified, in both compilers, byRealProducts.RealRootExponent. An exponent written as a rational short-circuits, so nothing that already compiled changes.Found by compilesweep at seed 13, on
(sin(x))^(1/(3 provided 3 > 1))at -1.3. No issue was filed. The four new rows inCompiledOddRootTestfail on master. The suite (18747), the five test projects and the eight harnesses pass, with 0 warnings. #2318's BREAKING entry gains a sentence and a row.🤖 Generated with Claude Code