[SciPy-Dev] lambertw test failure

Fredrik Johansson fredrik.johansson at gmail.com
Sun May 30 11:18:20 EDT 2010


On Sun, May 30, 2010 at 4:25 PM, Ralf Gommers
<ralf.gommers at googlemail.com>wrote:

> This test has been failing for a long time. Does anyone know what's going
> on, and can it be fixed in the next ten days or so?
>
> ======================================================================
> FAIL: test_lambertw.test_values
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/nose-0.11.1-py2.6.egg/nose/case.py",
> line 183, in runTest
>     self.test(*self.arg)
>   File "/Users/rgommers/Code/scipy/scipy/special/tests/test_lambertw.py",
> line 80, in test_values
>     FuncData(w, data, (0,1), 2, rtol=1e-10, atol=1e-13).check()
>   File "/Users/rgommers/Code/scipy/scipy/special/tests/testutils.py", line
> 187, in check
>     assert False, "\n".join(msg)
> AssertionError:
> Max |adiff|: 2.5797
> Max |rdiff|: 3.81511
> Bad results for the following points (in output 0):
> (-0.44800000000000001+0.40000000000000002j)                              0j
> => (-1.2370928928166736-1.6588828572971359j) !=
> (-0.11855133765652383+0.66570534313583418j)  (rdiff
> 3.8151122286225245)
>
> There's also a ticket regarding the lambertw docstring:
> http://projects.scipy.org/scipy/ticket/1148
>
> Thanks,
> Ralf
>

I think two lines were left out when the mpmath code was transliterated to
Cython. In lambertw.pyx, I believe

        if zabs(z+0.5) < 0.1:
            if z.imag > 0:
                w = 0.7 + 0.7j
            else:
                w = 0.7 - 0.7j

needs to be

        if zabs(z+0.5) < 0.1:
            if z.imag > 0:
                w = 0.7 + 0.7j
            else:
                w = 0.7 - 0.7j
        else:
            w = z

Fredrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100530/08533b07/attachment.html>


More information about the SciPy-Dev mailing list