Repository navigation
Solve a linear function times an exponential by the Lambert W function - #2203
Merged
Rafael-SOWNet merged 1 commit intoOct 29, 2026
Conversation
An equation K (a x + b) c^(g x + d) = k, with one such term in x, has
the roots W(A) / (g ln c) - b / a, where
A = k g ln c e^(b g ln c / a - d ln c) / (K a).
Over the complex numbers the answer is the family over every branch,
lambertw(n, A). Over the reals it is W_0 alone for A >= 0 or A = -1/e,
both W_0 and W_-1 for -1/e < A < 0, and nothing below -1/e; a symbolic
A carries those ranges as conditions.
x e^x = 2 was a decimal root found by Newton's method, and over the
reals a set of complex decimals as well; it is now { lambertw(2) }.
Part of #2182
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2203 +/- ##
==========================================
+ Coverage 86.55% 86.58% +0.02%
==========================================
Files 300 301 +1
Lines 66717 66764 +47
Branches 19357 19372 +15
==========================================
+ Hits 57747 57805 +58
+ Misses 4882 4870 -12
- Partials 4088 4089 +1
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
a-linear-times-an-exponential-is-solved-by-the-lambert-w-function
branch
October 29, 2026 16:30
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.
Part of #2182.
K (a x + b) c^(g x + d) = k, with exactly one such term inx, is solved by the Lambert W function:x = W(A) / (g ln c) - b / a.{ lambertw(n_1, A) }, every branch, written the way the periodic solvers write theirs.W_0forA >= 0orA = -1/e,W_0andW_(-1)for-1/e < A < 0, nothing below-1/e. A symbolicAcarries those ranges as conditions.x e^x = 2{ lambertw(n_1, 2) }x e^x = 2, reals{ lambertw(2) }x e^x = -1/4, reals{ lambertw(-1/4), lambertw(-1, -1/4) }x e^x = -1, reals{ }x * 2^x = 5{ lambertw(n_1, 5 ln 2) / ln 2 }The solver runs after the polynomial solver and before the exponential and substitution solvers. It needs an exponential, so it never answers a polynomial, and it needs a factor linear in
x, so a sum of exponentials stays with the existing solvers.Tests:
LambertWSolveTest, 10 cases. Every numeric root is substituted back and must leave under 1e-25, the complex families at branches -2, 0, 1 and 3; the real roots are also compared with their closed forms, and the symbolic case checks that both roots carry their conditions. Full suite 17823/0; interactive trio; AOT smoke 63/0; all frameworks build.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura