Overflow encountered with tanh and coth functions #2967
Labels
bug
category:numerical
dependencies
Pull requests that update a dependency file, or issues that lie primarily in a dependency
help wanted
Hi, I work with impedance spectroscopy and I sometimes have to deal with large complex numbers. I have experience NaN results. I think the mathjs tanh implementation has an overflow issue as I do not experience this problem with Python. Take for instance the problem below:
So I thought I'd share my implementation below. Maybe it helps. It is a translation of numba's implementation to JavaScript
https://github.com/numba/numba/blob/c04edc02deb40b84c3b21ed2a9835353181a5916/numba/targets/cmathimpl.py#L343-L367:
The text was updated successfully, but these errors were encountered: