upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

lambertw is sometimes wrong #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
mpmath.lambertw(-mpmath.log(mpmath.mpc(1.4 ,0.633)),0)
returns
mpc(real='-1.2605156720338708', imag='1.7173503371737457')
this is the same value as for the branch 1.

The correct values must differ, they are:
0.7232832635 + 0.1803146260*I for branch 0 and
-1.188149953 + 4.899092880*I for branch 1.

In [31]: mpmath.__version__
Out[31]: '0.13'

on gentoo under sage

Original issue reported on code.google.com by bo198...@gmail.com on 15 Nov 2009 at 10:39

GoogleCodeExporter commented 9 years ago
This was fixed recently:

>>> lambertw(-log(1.4+0.633j), 0)
(-0.0898822687030672 - 0.654615193139758j)
>>> lambertw(-log(1.4+0.633j), 1)
(-1.26051567203387 + 1.71735033717375j)
>>> lambertw(1.4+0.633j, 0)
(0.72328326351977 + 0.180314625964501j)
>>> lambertw(1.4+0.633j, 1)
(-1.18814995265427 + 4.89909287972991j)

Original comment by fredrik....@gmail.com on 7 Jan 2010 at 10:03