[Bug math/34441] New: math: sinh() returns wrong results for some inputs with |x| > 36.736801

"adhemerval.zanella at linaro dot org via Glibc-bugs" <[email protected]> Mon, 27 Jul 2026 16:40:37 +0000
Newsgroups gmane.comp.lib.glibc.bugs
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=3D34441

            Bug ID: 34441
           Summary: math: sinh() returns wrong results for some inputs
                    with |x| > 36.736801
           Product: glibc
           Version: 2.44
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: adhemerval.zanella at linaro dot org
  Target Milestone: ---

The CORE-MATH-based double-precision sinh added in glibc 2.44 (commit
106f8c2ed68a, "math: Use sinh from CORE-MATH") mistranslated the scaling of=
 the
accurate-path result for 36.736801 < |x| < 710.47586. The upstream CORE-MATH
code multiplies by the scale factor sp.f, while the commit used a wrong
transformation with asuint64.

Reproducer:


#include <math.h>
#include <stdio.h>
int main (void)
{
  volatile double x =3D 0x1.2b4f4e0bb49c9p+5;   /* ~37.41 */
  printf ("%a\n", sinh (x));
  /* prints 0x1.082dc780c66ebp+64 (~1.9e19),
     correct is 0x1.f7c28f05c4c1ep+52 (~8.9e15) */
  return 0;
}

Other affected inputs include =C2=B10x1.2ac43fb6d3abap+5 on directed roundi=
ng modes.

Additionally, commit f05c4907a27 ("math: Consolidated common definition/data
for cosh/sinh/tanh") dropped two of the 51 exceptional-case table entries
(0x1.b7efa91915c95p-2 and 0x1.92a5c27afbe82p+4) when moving the table from
e_sinh.c to e_sinh_data.c, causing 1-ulp errors on directed rounding modes =
for
those inputs (e.g. sinh(-0x1.b7efa91915c95p-2) rounded upward returns
-0x1.c59869f17b483p-2 instead of -0x1.c59869f17b482p-2).

Found with exhaustive ulp checking against the CORE-MATH reference (all
rounding modes, [-710,-1] range scan plus the CORE-MATH sinh.wc worst-case
list).

--=20
You are receiving this mail because:
You are on the CC list for the bug.=