The array API spec states, for tanh complex special cases
If a is +infinity and b is a positive (i.e., greater than 0) finite number, the result is 1 + 0j
from open-std pages describing ctanh
— ctanh(+∞ + iy) returns 1 + i0sin(2y), for positive-signed finite y.
This matches up to the math (we can derive this from tanh(x + iy) taking the limit as x approaches infinity and constraining y to be finite), and gives us 1 ± 0i, with the sign being inherited from sin(2y) if we care about signed zeros, rather than positive zero in all cases.
This was brought up because this special case is tested by the array API tests, which causes dpnp to fail the test.
The array API spec states, for
tanhcomplex special casesfrom open-std pages describing
ctanhThis matches up to the math (we can derive this from
tanh(x + iy)taking the limit asxapproaches infinity and constrainingyto be finite), and gives us1 ± 0i, with the sign being inherited fromsin(2y)if we care about signed zeros, rather than positive zero in all cases.This was brought up because this special case is tested by the array API tests, which causes dpnp to fail the test.