[Numpy-discussion] Ticket #1113, change title?

David Warde-Farley dwf at cs.toronto.edu
Sat May 23 15:37:19 EDT 2009


On 23-May-09, at 2:33 PM, Pauli Virtanen wrote:

>> Yes, I was wondering about that too, though notably the tests pass on
>> x86, and in fact the result on ppc was nowhere near 0 when I  
>> checked it.
>
> What do you mean by "nowhere near"? What does the following output for
> you:
>
>>>> np.arctanh(np.array([1e-5 + 1e-5j], np.complex64))
> array([  9.99999975e-06 +9.99999975e-06j], dtype=complex64)

I must've been hallucinating: this is on ppc64. I remembered it being  
closer to 1e-1,

 >>> dtype = np.complex64
 >>> z = np.array([1e-5*(1+1j)], dtype=dtype)
 >>> p = 9.999999999333333333e-6 + 1.000000000066666666e-5j
 >>> d = np.absolute(1-np.arctanh(z)/p)
 >>> d
array([  2.75662915e-09], dtype=float32)
 >>> np.finfo('complex64').eps
1.1920929e-07
 >>> _ * 5
5.9604644775390625e-07

So I guess it is pretty small, and small enough to pass the revised  
test condition you gave above.

David



More information about the NumPy-Discussion mailing list