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
tanh and coth drop a small real part, and sec and csc of a complex argument keep 88 digits #2701
On master (82eb869), tanh and coth drop a real part that is small compared with the imaginary part, and sec and csc of a complex argument keep fewer than the working digits. Reference values are from mpmath at 120 digits.
.Evaled
master
true value
tanh(10^(-60) + i)
1.5574077246549022…i
3.42551882081476E-60 + 1.5574077246549022…i
coth(10^(-60) + i)
-0.6420926159343307…i
1.41228292743739E-60 - 0.6420926159343307…i
sec(1/2 - 30 * i), csc(1/2 - 30 * i)
right to 88 digits
The tanh and coth rows are the class #2677 fixed for ln, roots, arcoth and Ci (#2681): a part much smaller than the input is dropped. The sec and csc loss is in the complex reciprocal, as seen by #2699's sweep. Both are the same on #2699's branch.
One more tanh row, found by #2700's sweep. Here the imaginary part is kept but has half its value, on master 28bec0a. mpmath at 200 digits:
.Evaled
master
true value
tanh(-100 + i)
-1 + 1.2583735507547136…E-87 i
-1 + 2.5167471015094273…E-87 i
tanh(-100 + 1/3 * i)
-1 + 8.5575982270708942…E-88 i
-1 + 1.7115196454141788…E-87 i
tanh(100 + i)
1
1 + 2.5167471015094273…E-87 i
The -100 rows are wrong values. The +100 row drops a part below 1e-50 of the modulus. That is the library's existing convention, so it is not the same defect.
Activity
Rafael-SOWNet commentedon Dec 4, 2026
One more
tanhrow, found by #2700's sweep. Here the imaginary part is kept but has half its value, on master 28bec0a. mpmath at 200 digits:.Evaledtanh(-100 + i)-1 + 1.2583735507547136…E-87 i-1 + 2.5167471015094273…E-87 itanh(-100 + 1/3 * i)-1 + 8.5575982270708942…E-88 i-1 + 1.7115196454141788…E-87 itanh(100 + i)11 + 2.5167471015094273…E-87 iThe
-100rows are wrong values. The+100row drops a part below1e-50of the modulus. That is the library's existing convention, so it is not the same defect.