Skip to content

Commit 283f025

Browse files
authored
Merge pull request #22107 from charris/backport-22083
BUG: Fix skip condition for test_loss_of_precision[complex256]
2 parents 72b98a0 + 3fdeae2 commit 283f025

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

numpy/core/tests/test_umath.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ def on_powerpc():
2727

2828

2929
def bad_arcsinh():
30-
"""The blocklisted trig functions are not accurate on aarch64 for
30+
"""The blocklisted trig functions are not accurate on aarch64/PPC for
3131
complex256. Rather than dig through the actual problem skip the
3232
test. This should be fixed when we can move past glibc2.17
3333
which is the version in manylinux2014
3434
"""
35-
x = 1.78e-10
35+
if platform.machine() == 'aarch64':
36+
x = 1.78e-10
37+
elif on_powerpc():
38+
x = 2.16e-10
39+
else:
40+
return False
3641
v1 = np.arcsinh(np.float128(x))
3742
v2 = np.arcsinh(np.complex256(x)).real
3843
# The eps for float128 is 1-e33, so this is way bigger
@@ -3515,10 +3520,10 @@ def check(x, rtol):
35153520
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)
35163521

35173522
if dtype is np.longcomplex:
3518-
if (platform.machine() == 'aarch64' and bad_arcsinh()):
3523+
if bad_arcsinh():
35193524
pytest.skip("Trig functions of np.longcomplex values known "
3520-
"to be inaccurate on aarch64 for some compilation "
3521-
"configurations.")
3525+
"to be inaccurate on aarch64 and PPC for some "
3526+
"compilation configurations.")
35223527
# It's not guaranteed that the system-provided arc functions
35233528
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)
35243529
# So, give more leeway for long complex tests here:

0 commit comments

Comments
 (0)