Repository navigation
Read a power's domain condition over the reals and off the real line - #2747
Open
Rafael-SOWNet wants to merge 1 commit into
Open
Rafael-SOWNet wants to merge 1 commit into
Rafael-SOWNet wants to merge 1 commit into
Conversation
Over the reals a negative base has a real power only where the exponent is a whole number or a fraction of odd denominator below 10, whose real root the library takes. Powf.IntrinsicCondition restricted the base only for a literal even root, so x^pi, x^x and (-1)^x were taken as defined where their real reading is NaN, and x^(1/11) too, whose principal root is not real. The condition is now x >= 0 for any other number, and for a symbolic exponent e it names the fractions the real root is taken for: x >= 0 or 5e in ZZ or 7e in ZZ or 9e in ZZ, the numbers whose denominator divides 5, 7 or 9. That is exactly the library's set, so the condition is not stricter than the values. Off the real line the zero-base part said w > 0 for an exponent that is not a number, which has no value at a non-real w: domain(0^x) was NaN at 1 + i, where 0^(1 + i) is 0. It reads Re(w) > 0 now, as #1865 did for a constant exponent, and so does the incomplete gamma function's condition at a lower limit of 0. Simplify(0^x) wrote its condition as x (1 + 1/sgn(x)^2) > 0, which had no value at 0; it writes Re(x) > 0. PredicateEntailment reads through Re so x^x provided not x = 0 still drops its redundant condition. Measured on 9b75a26 and this branch: domaincheck's real "holds where the real reading has no value" goes from 98 to 9 in random compositions (the 9 left are lambertw at -1/e and a polygamma row) and from 4 to 2 in the listed nodes, with "fails where it has a value" unchanged (105, 6). The sweep's 18383 real-reading rows: 263 too loose and 63 undecided become right, none newly wrong; its 76513 complex rows: 106 undecided become right, none newly wrong. CasBench, RootCheck, SimpSweep, PropCheck and BoundCheck agree on both. Unit suite 22399 passed, 0 failed; the new tests fail on master in 17 rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2747 +/- ##
==========================================
+ Coverage 86.69% 86.70% +0.01%
==========================================
Files 346 346
Lines 76972 76980 +8
Branches 22648 22651 +3
==========================================
+ Hits 66729 66746 +17
+ Misses 5522 5516 -6
+ Partials 4721 4718 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
What was wrong
domain(x^pi, RR),domain((-1)^x, RR)anddomain(x^(1/11), RR)wereTrue, andx^xwas accepted at -1/2, at points where the real reading isNaN.w > 0for an exponent that is not a number.w > 0has no value at a non-realw, sodomain(0^x)wasNaNat1 + i, where0^(1 + i)is 0.The fix
x >= 0;egetsx >= 0 or 5e in ZZ or 7e in ZZ or 9e in ZZ. Those are exactly the fractions whose denominator divides 5, 7 or 9, so the condition matches the values and is no stricter than them.Re(w) > 0, as Zero times a power with a non-real exponent is NaN #1865 already did for a constant exponent. The incomplete gamma function's condition at a lower limit of 0 gets the same change.Simplify(0^x)wrote its condition asx (1 + 1/sgn(x)^2) > 0, which has no value at 0. It is nowRe(x) > 0.PredicateEntailmentnow reads throughRe, sox^x provided not x = 0still simplifies tox ^ x.What I measured (master 9b75a26 against this branch)
domaincheck, rows where the real condition holds but the real reading has no value:lambertwat -1/e and onepolygammarow, neither a power.Re.Fixes #2739
Fixes #2740
🤖 Generated with Claude Code