-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior