[Numpy-discussion] Branch cuts, inf, nan, C99 compliance

Nils Wagner nwagner@iam.uni-stuttgart...
Sun Jul 20 03:18:47 CDT 2008


On Sat, 19 Jul 2008 13:29:45 -0500
  "Travis E. Oliphant" <oliphant@enthought.com> wrote:
> Pauli Virtanen wrote:
>> Hi all,
>>
>> Re: Ticket 854.
>>
>> I wrote tests for the branch cuts for all complex arc* 
>>functions
>> in umathmodule. It turns out that all except arccosh 
>>were OK.
>> The formula for arcsinh was written in a non-standard 
>>form with
>> an unnecessary nc_neg, but this didn't affect the 
>>results.
>> I also wrote tests for checking values of the functions 
>>at infs and nans.
>>   
> 
> Thanks for looking into these.   These functions were 
>contributed by 
> Konrad Hinsen (IIRC) many years ago and I don't think 
>they've really 
> been reviewed since then.   
> 
> I'm all for using C99 when it is available and improving 
>these functions 
> with help from cmathmodule.  IIRC, the cmathmodule was 
>contributed by 
> Konrad originally also.
> 
> So +1 on C99 standardization.
> 
> -Travis
> 
  
======================================================================
ERROR: test_umath.TestC99.test_catanh(<ufunc 'arctanh'>, 
(nan, nan), (nan, nan), '')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/case.py", 
line 182, in runTest
     self.test(*self.arg)
   File 
"/usr/lib/python2.4/site-packages/numpy/core/tests/test_umath.py", 
line 405, in _check
     func(point)
FloatingPointError: invalid value encountered in arctanh

======================================================================
ERROR: test_umath.TestC99.test_clog(<ufunc 'log'>, (1.0, 
nan), (nan, nan), '')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/case.py", 
line 182, in runTest
     self.test(*self.arg)
   File 
"/usr/lib/python2.4/site-packages/numpy/core/tests/test_umath.py", 
line 405, in _check
     func(point)
FloatingPointError: invalid value encountered in log

======================================================================
ERROR: test_umath.TestC99.test_clog(<ufunc 'log'>, (nan, 
0.0), (nan, nan), '')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/case.py", 
line 182, in runTest
     self.test(*self.arg)
   File 
"/usr/lib/python2.4/site-packages/numpy/core/tests/test_umath.py", 
line 405, in _check
     func(point)
FloatingPointError: invalid value encountered in log

======================================================================
ERROR: test_umath.TestC99.test_clog(<ufunc 'log'>, (nan, 
1.0), (nan, nan), '')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/case.py", 
line 182, in runTest
     self.test(*self.arg)
   File 
"/usr/lib/python2.4/site-packages/numpy/core/tests/test_umath.py", 
line 405, in _check
     func(point)
FloatingPointError: invalid value encountered in log

======================================================================
ERROR: test_umath.TestC99.test_clog(<ufunc 'log'>, (nan, 
nan), (nan, nan), '')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/usr/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg/nose/case.py", 
line 182, in runTest
     self.test(*self.arg)
   File 
"/usr/lib/python2.4/site-packages/numpy/core/tests/test_umath.py", 
line 405, in _check
     func(point)
FloatingPointError: invalid value encountered in log

----------------------------------------------------------------------
Ran 2070 tests in 35.424s

FAILED (SKIP=41, errors=5)
<nose.result.TextTestResult run=2070 errors=5 failures=0>

Nils



More information about the Numpy-discussion mailing list