Skip to content

arcoth, arcsch, arsech, a square root and Ci drop a part much smaller than their input #2677

Description

@Rafael-SOWNet

On master (4674e66), these evaluations drop a value or a part that is small relative to the rest of the input. Reference values are from mpmath at 400 digits.

.Evaled master true value
arcoth(10^20), arcsch(10^20) 1.0E-20 same (correct)
arcoth(10^60) 0 1.0E-60
arcsch(10^60) 0 1.0E-60
arsech(10^50 * i) -1.5707…i 1.0E-50 - 1.5707…i
(1 + 10^(-50) * i)^(1/2) 1 1 + 5.0E-51i
Ci(10^60 + i) 0 1.28136E-60 - 6.54802E-61i

Two causes look likely. Both are unconfirmed.

  • The parser writes arcoth(x) as 1/2 * ln((x + 1) / (x - 1)), and arcsch and arsech are expanded the same way. A logarithm of 1 + tiny loses tiny relative to the 1.
  • The root search rounds a phase of 5e-51 onto 0.

Found while fixing #2675 (#2676), which leaves these unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions