-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimal.lambertw
occasionally spikes with inputs around the ee31 range
#163
Comments
I've added some debug lines to the The cause appears to be that Although
|
wewz = w.sub(z.mul(ew)); |
z.mul(ew)
in the .sub()
call of wewz = w.sub(z.mul(ew))
with 1
, which is what it simplifies to after undoing the substitutions. Note: Only tested with certain numbers in the principal branch; needs testing for the real non-principal branch and over a wider range of numbers.EDIT 2: The above fix does not appear to converge for smaller numbers (layer 1). A better solution may be needed.
When running the following:
the output is
The second value is many orders of magnitude higher that of the first and third values, effectively a large spike.
The correct answer for the second expression is approximately midway between the first value and the third value.
Some more test cases, all of which return incorrect values
Code to generate the above test cases
The text was updated successfully, but these errors were encountered: