Skip to content

arsinh and arcsch of a small argument keep only some of their digits #2686

Description

@Rafael-SOWNet

On master (0b1b7d7), arsinh and arcsch keep only some of the 100 working digits for a small argument, and how many depends on the exponent. Digits counted against mpmath at 400 digits:

.Evaled digits right
arsinh(10^(-20)), arsinh(10^(-30)), arsinh(10^(-35)) 100
arsinh(10^(-25)) 25
arsinh(10^(-40)) 40
arsinh(10^(-50)) 50
arsinh(10^(-60)) 60
arsinh(10^(-80)) 80
arsinh(10^(-99)) 99
arcsch(10^40), arcsch(10^60) 40, 60

For example, arsinh(10^(-60)) gives 9.999999999999999999999999999999999999999999999999999999999995E-61. The true value is 1E-60 - 1.6667E-181, so the result is off by x^2/2. That is what ln(x + sqrt(x^2 + 1)) gives when sqrt(1 + x^2) rounds to 1 and the logarithm then subtracts x^2/2. That is unconfirmed: it does not explain why 10^(-30) and 10^(-35) come out right.

arcsin(10^(-20)), artanh(10^(-20)) and ln(1 + 10^(-20)) are right. These values are the same on abd100a, before #2684.

Found while checking #2684's probe against mpmath.

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