[pypy-dev] numpy fails trigonometry with complex numbers, what to do?
fijall at gmail.com
Wed Sep 5 11:20:49 CEST 2012
On Wed, Sep 5, 2012 at 3:30 AM, Matti Picus <matti.picus at gmail.com> wrote:
> I am trying to complete complex numbers in numpypy.
> Progress is good, I picked up from previous work on the numpypy-complex2
> Complex numbers come with extensive tests, it seems all the corner cases are
> In porting the tests to numpypy, I came across a problem: numpy returns
> different results than cmath.
> Some of the differences are due to the fact that numpy does not raise a
> ValueError for dividing by 0 or other silly input values,
> but other differences are inexplicable (note the sign of the imaginary
> or this one:
> Should I ignore the inconsistencies, or fix the 700 out of 2300 test
> instance failures?
> What should pypy's numpypy do - be consistent with numpy or with cmath?
> cmath is easier and probably faster (no need to mangle results or input
> args), so I would prefer cmath to trying to understand the logic behind
If you ask me, cmath is correct and numpy just didn't care. Maybe you
should submit a bug report to them instead?
More information about the pypy-dev