Skip to content

arcosh, arsech, artanh and arcoth lose digits near their zero, and arcosh(1 + 10^-120) is 0 #2689

Backlog

Description

@Rafael-SOWNet

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.

Found by #2688's mpmath 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