I'll file a ticket.

Incidentally, if tanh(z) is simply programmed as

(1.0 - exp(-2.0*z)) / (1.0 + exp(-2.0*z))

the problem is fixed.

Thanks, Mark

[clip]
> > Not for large complex values:
> >
> > In [85]: tanh(1000+0j)
> > Out[85]: (nan+nan*j)
>
> Yep, it's a bug. Care to file a ticket?
>
> The implementation is just sinh/cosh, which overflows.
> The fix is to provide an asymptotic expansion (sgn Re z),
> although around the imaginary axis the switch is perhaps
> somewhat messy to handle.
>
>
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to