Skip to content

cos, sin and tan of a large imaginary argument are NaN where cosh gives +oo and tan is i #2698

Description

@Rafael-SOWNet

On master (82eb869), cos, sin and tan of a large imaginary argument are NaN once cosh of its size passes the largest number the library represents. The hyperbolic function of the same size gives +oo. Reference values are from mpmath at 50 digits.

.Evaled master true value
cos(10^5 * i) 1.40333168021306…E+43429 same (correct)
cosh(10^6) +oo 1.51661E+434294
cos(10^6 * i) … cos(10^10 * i) NaN cosh(10^k), real and beyond the range, so +oo as for cosh
sin(10^6 * i) … sin(10^10 * i) NaN i sinh(10^k), so +ooi
tan(10^6 * i) … tan(10^10 * i) NaN i tanh(10^k), which is i to every working digit

tan is the clearest case. Its value is i to every working digit and well inside the range, yet it comes out NaN, presumably because it is computed as sin/cos and both overflow. That is unconfirmed.

Found by #2695's sweep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions