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
arcosh, arsech, artanh and arcoth lose digits near their zero, and arcosh(1 + 10^-120) is 0 #2689
On master (0b1b7d7), arcosh, arsech, artanh and arcoth lose digits near the point where they are 0, and arcosh and arsech return 0 for an argument close enough to 1. Digits counted against mpmath at 600 digits:
.Evaled
master
true value
digits right
arcosh(1 + 10^(-20)), arsech(1 - 10^(-20))
1.4142136E-10
1.4142136E-10
89
arcosh(1 + 10^(-40)), arsech(1 - 10^(-40))
1.4142136E-20
1.4142136E-20
79
arcosh(1 + 10^(-120)), arsech(1 - 10^(-120))
0
1.4142136E-60
0
artanh(10^(-20)), arcoth(10^20)
1E-20
1E-20
80
artanh(10^(-40)), artanh(10^(-60)), arcoth(10^40)
99 or more
ln(1 + x), arcsin, arctan, sinh, tanh and exp(x) - 1 at 10^(-40) keep 99 or 100 digits.
This is the same kind of loss as #2686 (arsinh and arcsch, fixed in #2688). There the cause was sqrt(1 + x^2) being rounded onto 1 and a sum near 1 being rounded at the working digits. arcosh(1 + 10^(-120)) is ln(x + sqrt(x^2 - 1)) with x^2 - 1 = 2E-120 + 1E-240, exact and representable, so a value of 0 is not forced by the working digits. The cause here is unconfirmed.
Activity