You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cos, sin and tan of a large imaginary argument are NaN where cosh gives +oo and tan is i #2698
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.
Activity