Skip to content

tanh and coth drop a small real part, and sec and csc of a complex argument keep 88 digits #2701

Backlog

Description

@Rafael-SOWNet

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.

Found by #2699's sweep.

Activity

  1. added this to the 2.11 milestone on Dec 4, 2026
  2. added theissue type on Dec 4, 2026
  3. Rafael-SOWNet commented on Dec 4, 2026

    @Rafael-SOWNet
    MemberAuthor

    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.

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