Skip to content

Leave sign of 0 unspecified for tanh inf + yj #1006

@ndgrigorian

Description

@ndgrigorian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions