I'll file a ticket.<br><br>Incidentally, if tanh(z) is simply programmed as <br><br>(1.0 - exp(-2.0*z)) / (1.0 + exp(-2.0*z))<br><br>the problem is fixed.<br><br>Thanks, Mark<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre>[clip]<br>> Not for large complex values:<br>> <br>> In [85]: tanh(1000+0j)<br>> Out[85]: (nan+nan*j)<br><br>Yep, it's a bug. Care to file a ticket?<br>
<br>The implementation is just sinh/cosh, which overflows. <br>The fix is to provide an asymptotic expansion (sgn Re z),<br>although around the imaginary axis the switch is perhaps<br>somewhat messy to handle.<br></pre>
</blockquote></div><br>