]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Sync atanh from CORE-MATH
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 19 Nov 2025 18:21:44 +0000 (15:21 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 19 Nov 2025 18:21:44 +0000 (15:21 -0300)
The CORE-MATH commit 703d7487 fixes some issues for RNDZ:

Failure: Test: atanh_towardzero (0x5.96200b978b69cp-4)
Result:
 is:          3.6447730550366463e-01   0x1.753989ed16faap-2
 should be:   3.6447730550366458e-01   0x1.753989ed16fa9p-2
 difference:  5.5511151231257827e-17   0x1.0000000000000p-54
 ulp       :  1.0000
 max.ulp   :  0.0000
Maximal error of `atanh_towardzero'
 is      : 1 ulp
 accepted: 0 ulp

Checked on x86_64-linux-gnu, x86_64-linux-gnu-v3, aarch64-linux-gnu,
and i686-linux-gnu.

SHARED-FILES
math/auto-libm-test-in
math/auto-libm-test-out-atanh
sysdeps/ieee754/dbl-64/e_atanh.c

index 38fc87a79cfb7f05cbf705d272da64e43dca51bd..cced02d6a9a7f28124d35af4d3632109f6933c31 100644 (file)
@@ -246,7 +246,7 @@ tzdata:
 core-math:
   # src/binary64/acosh/acosh.c, revision 6736002f
   sysdeps/ieee754/dbl-64/e_acosh.c
-  # src/binary64/atanh/atanh.c, revision c9abdf80
+  # src/binary64/atanh/atanh.c, revision 703d7487
   sysdeps/ieee754/dbl-64/e_atanh.c
   # src/binary64/tgamma/tgamma.c, revision 0f185e23
   sysdeps/ieee754/dbl-64/e_gamma_r.c
index 0e5b27397056745bb63a9516b2b739e4d1a3ff12..0af70373fcd78cd73465fa6fc8725e2e93615a04 100644 (file)
@@ -896,6 +896,7 @@ atanh -0x3.98eaf4p-4
 atanh 0x2.c1085p-4
 atanh 0x1p-500
 atanh 0x1p-5000
+atanh 0x1.658802e5e2da7p-2
 # the next value generates larger error bounds in libmvec/avx512 on x86_64
 # (binary32)
 atanh 0x1.f80094p-8
index a5243264be8a52c9936e64f9ccc87813c2ee48d8..757d08952dab83a8e9b95d79977fe57bf7dad691 100644 (file)
@@ -3112,6 +3112,75 @@ atanh 0x1p-5000
 = atanh tonearest binary128 0x1p-5000 : 0x1p-5000 : inexact-ok
 = atanh towardzero binary128 0x1p-5000 : 0x1p-5000 : inexact-ok
 = atanh upward binary128 0x1p-5000 : 0x1.0000000000000000000000000001p-5000 : inexact-ok
+atanh 0x1.658802e5e2da7p-2
+= atanh downward binary32 0x5.96201p-4 : 0x5.d4e628p-4 : inexact-ok
+= atanh tonearest binary32 0x5.96201p-4 : 0x5.d4e63p-4 : inexact-ok
+= atanh towardzero binary32 0x5.96201p-4 : 0x5.d4e628p-4 : inexact-ok
+= atanh upward binary32 0x5.96201p-4 : 0x5.d4e63p-4 : inexact-ok
+= atanh downward binary64 0x5.96201p-4 : 0x5.d4e62cb97acp-4 : inexact-ok
+= atanh tonearest binary64 0x5.96201p-4 : 0x5.d4e62cb97acp-4 : inexact-ok
+= atanh towardzero binary64 0x5.96201p-4 : 0x5.d4e62cb97acp-4 : inexact-ok
+= atanh upward binary64 0x5.96201p-4 : 0x5.d4e62cb97ac04p-4 : inexact-ok
+= atanh downward intel96 0x5.96201p-4 : 0x5.d4e62cb97ac010f8p-4 : inexact-ok
+= atanh tonearest intel96 0x5.96201p-4 : 0x5.d4e62cb97ac011p-4 : inexact-ok
+= atanh towardzero intel96 0x5.96201p-4 : 0x5.d4e62cb97ac010f8p-4 : inexact-ok
+= atanh upward intel96 0x5.96201p-4 : 0x5.d4e62cb97ac011p-4 : inexact-ok
+= atanh downward m68k96 0x5.96201p-4 : 0x5.d4e62cb97ac010f8p-4 : inexact-ok
+= atanh tonearest m68k96 0x5.96201p-4 : 0x5.d4e62cb97ac011p-4 : inexact-ok
+= atanh towardzero m68k96 0x5.96201p-4 : 0x5.d4e62cb97ac010f8p-4 : inexact-ok
+= atanh upward m68k96 0x5.96201p-4 : 0x5.d4e62cb97ac011p-4 : inexact-ok
+= atanh downward binary128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52dp-4 : inexact-ok
+= atanh tonearest binary128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52d4p-4 : inexact-ok
+= atanh towardzero binary128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52dp-4 : inexact-ok
+= atanh upward binary128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52d4p-4 : inexact-ok
+= atanh downward ibm128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52p-4 : inexact-ok
+= atanh tonearest ibm128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52p-4 : inexact-ok
+= atanh towardzero ibm128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad52p-4 : inexact-ok
+= atanh upward ibm128 0x5.96201p-4 : 0x5.d4e62cb97ac010fda7013fad54p-4 : inexact-ok
+= atanh downward binary32 0x5.962008p-4 : 0x5.d4e62p-4 : inexact-ok
+= atanh tonearest binary32 0x5.962008p-4 : 0x5.d4e62p-4 : inexact-ok
+= atanh towardzero binary32 0x5.962008p-4 : 0x5.d4e62p-4 : inexact-ok
+= atanh upward binary32 0x5.962008p-4 : 0x5.d4e628p-4 : inexact-ok
+= atanh downward binary64 0x5.962008p-4 : 0x5.d4e6239d271fcp-4 : inexact-ok
+= atanh tonearest binary64 0x5.962008p-4 : 0x5.d4e6239d271fcp-4 : inexact-ok
+= atanh towardzero binary64 0x5.962008p-4 : 0x5.d4e6239d271fcp-4 : inexact-ok
+= atanh upward binary64 0x5.962008p-4 : 0x5.d4e6239d272p-4 : inexact-ok
+= atanh downward intel96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh tonearest intel96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh towardzero intel96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh upward intel96 0x5.962008p-4 : 0x5.d4e6239d271fcc98p-4 : inexact-ok
+= atanh downward m68k96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh tonearest m68k96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh towardzero m68k96 0x5.962008p-4 : 0x5.d4e6239d271fcc9p-4 : inexact-ok
+= atanh upward m68k96 0x5.962008p-4 : 0x5.d4e6239d271fcc98p-4 : inexact-ok
+= atanh downward binary128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622d48p-4 : inexact-ok
+= atanh tonearest binary128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622d4cp-4 : inexact-ok
+= atanh towardzero binary128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622d48p-4 : inexact-ok
+= atanh upward binary128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622d4cp-4 : inexact-ok
+= atanh downward ibm128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622cp-4 : inexact-ok
+= atanh tonearest ibm128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622ep-4 : inexact-ok
+= atanh towardzero ibm128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622cp-4 : inexact-ok
+= atanh upward ibm128 0x5.962008p-4 : 0x5.d4e6239d271fcc91b25d7d622ep-4 : inexact-ok
+= atanh downward binary64 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea4p-4 : inexact-ok
+= atanh tonearest binary64 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh towardzero binary64 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea4p-4 : inexact-ok
+= atanh upward binary64 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh downward intel96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7ff8p-4 : inexact-ok
+= atanh tonearest intel96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh towardzero intel96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7ff8p-4 : inexact-ok
+= atanh upward intel96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh downward m68k96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7ff8p-4 : inexact-ok
+= atanh tonearest m68k96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh towardzero m68k96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7ff8p-4 : inexact-ok
+= atanh upward m68k96 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea8p-4 : inexact-ok
+= atanh downward binary128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036fp-4 : inexact-ok
+= atanh tonearest binary128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036f4p-4 : inexact-ok
+= atanh towardzero binary128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036fp-4 : inexact-ok
+= atanh upward binary128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036f4p-4 : inexact-ok
+= atanh downward ibm128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036p-4 : inexact-ok
+= atanh tonearest ibm128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036p-4 : inexact-ok
+= atanh towardzero ibm128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483036p-4 : inexact-ok
+= atanh upward ibm128 0x5.96200b978b69cp-4 : 0x5.d4e627b45bea7fffffe2483038p-4 : inexact-ok
 atanh 0x1.f80094p-8
 = atanh downward binary32 0x1.f80094p-8 : 0x1.f8031ep-8 : inexact-ok
 = atanh tonearest binary32 0x1.f80094p-8 : 0x1.f8032p-8 : inexact-ok
index 9ebc7bab8471e828db87ec5e8c4c13fb4a8585cb..68ef87818d809ac7e7d7b93df4553946aa3b69e3 100644 (file)
@@ -3,7 +3,7 @@
 Copyright (c) 2023-2025 Alexei Sibidanov.
 
 The original version of this file was copied from the CORE-MATH
-project (file src/binary64/atanh/atanh.c, revision 4da7f241).
+project (file src/binary64/atanh/atanh.c, revision 703d7487).
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -147,7 +147,7 @@ __ieee754_atanh (double x)
   ll += f;
   lh *= copysign (1, x);
   ll *= copysign (1, x);
-  double eps = 31e-24 + dx2 * 0x1p-49;
+  double eps = 34e-24 + dx2 * 0x1p-49;
   double lb = lh + (ll - eps), ub = lh + (ll + eps);
   if (__glibc_likely (lb == ub))
     return lb;