As in the title:
>>> mpmath.mp.tanh(mpmath.mp.mpc(mpmath.inf, mpmath.inf)) # expected (1+0j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tanh(mpmath.mp.mpc(mpmath.inf, -mpmath.inf)) # expected (1+0j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tanh(mpmath.mp.mpc(-mpmath.inf, mpmath.inf)) # expected (-1+0j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tanh(mpmath.mp.mpc(-mpmath.inf, -mpmath.inf)) # expected (-1+0j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tanh(mpmath.mp.mpc(mpmath.inf, 2)) # expected (1-0j)
mpc(real='nan', imag='0.0')
>>> mpmath.mp.tanh(mpmath.mp.mpc(-mpmath.inf, 2)) # expected (-1-0j)
mpc(real='nan', imag='0.0')
>>> mpmath.mp.tanh(mpmath.mp.mpc(0, -mpmath.inf)) # expected (nan+nanj)
mpc(real='0.0', imag='nan')
mpmath.fp.tanh returns expected results (except for the last sample).
>>> mpmath.mp.tan(mpmath.mp.mpc(mpmath.inf, mpmath.inf)) # expected (1j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(mpmath.inf, -mpmath.inf)) # expected (-1j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(-mpmath.inf, mpmath.inf)) # expected (1j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(-mpmath.inf, -mpmath.inf)) # expected (-1j)
mpc(real='nan', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(2, mpmath.inf)) # expected (-0+1j)
mpc(real='0.0', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(2, -mpmath.inf)) # expected (-0-1j)
mpc(real='0.0', imag='nan')
>>> mpmath.mp.tan(mpmath.mp.mpc(-mpmath.inf, 0)) # expected (nan+nanj)
mpc(real='nan', imag='0.0')
mpmath.fp.tan returns expected results (except for the last sample).
Expected values are defined in https://en.cppreference.com/w/cpp/numeric/complex/tanh and https://en.cppreference.com/w/cpp/numeric/complex/tan.
As in the title:
mpmath.fp.tanh returns expected results (except for the last sample).
mpmath.fp.tan returns expected results (except for the last sample).
Expected values are defined in https://en.cppreference.com/w/cpp/numeric/complex/tanh and https://en.cppreference.com/w/cpp/numeric/complex/tan.