Repository navigation
Over the reals, answer an exponential equation with real roots only - #2433
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
A positive base to a real power is positive, so over the reals a^u = v has a
root only for a positive v. Powf's inversion answered log(a, v) for every v, and
ln(-1), which is i pi, stayed a node that nothing read as non-real. Under the
real codomain the inversion now has no root where an enclosure of v's value
shows it is not a positive real; a v it cannot separate from the positive
reals, or a symbolic one, keeps its root as before.
The replacement search reads its replacement as real, which holds only where
the subtree it stands for is real at every real x. One that is not, such as
i x, is solved over the complex numbers, so e^(i x) = -1 keeps its root pi;
one that is, such as x^2, and has no real root, leaves x with none:
e^(x^2) = -1 is { }.
The complex codomain is unchanged. BREAKING-CHANGES.md rows measured on the
2.6.0 package and on this branch.
Closes #2425.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2433 +/- ##
==========================================
- Coverage 86.81% 86.81% -0.01%
==========================================
Files 312 312
Lines 69551 69573 +22
Branches 20316 20325 +9
==========================================
+ Hits 60383 60401 +18
- Misses 4932 4933 +1
- Partials 4236 4239 +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.
Closes #2425.
Under
MathS.Settings.Codomain.Set(Domain.Real), an exponential equation could answer a root that is not real.e^x + 1 = 0answered{ ln(-1) }, andln(-1)isiπ.There were two causes:
Powf.InvertNodeturneda^u = vintolog(a, v)for everyv. The real codomain is applied only inside particular solvers (the logarithm, Lambert W and modulus solvers), and the exponential inversion was not one of them.i x. It is now solved over the complex numbers in that case.Over the reals, the inversion now answers no root where the base is a positive real, the exponent is real-valued, and the value is decidedly not a positive real. That is decided by value, from a 40-digit enclosure, never by the printed form. Anything the check cannot decide keeps its root as before. Over the complex numbers, 31 equations give output identical character for character to master's.
e^x + 1 = 0{ ln(-1) }{ }{ }e^x - 2e^(-x) - 1 = 0{ ln(-1), ln(2) }{ ln(2) }{ ln(2) }2^x = -3{ log(2, -3) }{ }{ }3 e^x + 5 = 0{ ln(-5/3) }{ }{ }e^(2x) + e^x - 2 = 0{ 0, ln(-2) }{ 0 }{ 0 }e^x + e^(-x) = 1{ ln((1∓sqrt(-3))/2) }{ }{ }e^x - e^(-x) = 3{ ln((3-sqrt13)/2), ln((3+sqrt13)/2) }{ ln((3+sqrt13)/2) }e^x = -1 + i{ ln(-1+i) }{ }{ }e^(x^2) = -1{ ±sqrt(ln(-1)) }{ }{ }e^x - 2 = 0,e^(2x) - 3e^x + 2 = 0,ln(x) = 2,e^x = yThe rows are in BREAKING-CHANGES.md, measured on the 2.6.0 package. Not changed here, and still not filtered by the real codomain: polynomial roots (
x^2 = -1gives{ i, -i }) and trigonometric ones (sin(x) = 2).Checked on this branch:
iπ.🤖 Generated with Claude Code