@@ -1354,21 +1354,9 @@ def test_log_values(self):
1354
1354
1355
1355
# test log() of max for dtype does not raise
1356
1356
for dt in ['f' , 'd' , 'g' ]:
1357
- try :
1358
- with np .errstate (all = 'raise' ):
1359
- x = np .finfo (dt ).max
1360
- np .log (x )
1361
- except FloatingPointError as exc :
1362
- if dt == 'g' and IS_MUSL :
1363
- # FloatingPointError is known to occur on longdouble
1364
- # for musllinux_x86_64 x is very large
1365
- pytest .skip (
1366
- "Overflow has occurred for"
1367
- " np.log(np.finfo(np.longdouble).max)"
1368
- )
1369
- else :
1370
- raise exc
1371
-
1357
+ with np .errstate (all = 'raise' ):
1358
+ x = np .finfo (dt ).max
1359
+ np .log (x )
1372
1360
def test_log_strides (self ):
1373
1361
np .random .seed (42 )
1374
1362
strides = np .array ([- 4 ,- 3 ,- 2 ,- 1 ,1 ,2 ,3 ,4 ])
@@ -1712,6 +1700,9 @@ def test_arctanh(self):
1712
1700
assert_raises (FloatingPointError , np .arctanh ,
1713
1701
np .array (value , dtype = dt ))
1714
1702
1703
+ # Make sure glibc < 2.18 atanh is not used, issue 25087
1704
+ assert np .signbit (np .arctanh (- 1j ).real )
1705
+
1715
1706
# See: https://github.com/numpy/numpy/issues/20448
1716
1707
@pytest .mark .xfail (
1717
1708
_glibc_older_than ("2.17" ),
@@ -1896,9 +1887,9 @@ def test_ldexp(self, dtype, stride):
1896
1887
class TestFRExp :
1897
1888
@pytest .mark .parametrize ("stride" , [- 4 ,- 2 ,- 1 ,1 ,2 ,4 ])
1898
1889
@pytest .mark .parametrize ("dtype" , ['f' , 'd' ])
1899
- @pytest .mark .xfail (IS_MUSL , reason = "gh23048" )
1900
1890
@pytest .mark .skipif (not sys .platform .startswith ('linux' ),
1901
1891
reason = "np.frexp gives different answers for NAN/INF on windows and linux" )
1892
+ @pytest .mark .xfail (IS_MUSL , reason = "gh23049" )
1902
1893
def test_frexp (self , dtype , stride ):
1903
1894
arr = np .array ([np .nan , np .nan , np .inf , - np .inf , 0.0 , - 0.0 , 1.0 , - 1.0 ], dtype = dtype )
1904
1895
mant_true = np .array ([np .nan , np .nan , np .inf , - np .inf , 0.0 , - 0.0 , 0.5 , - 0.5 ], dtype = dtype )
@@ -4135,7 +4126,6 @@ def test_it(self):
4135
4126
assert_almost_equal (fz .real , fr , err_msg = 'real part %s' % f )
4136
4127
assert_almost_equal (fz .imag , 0. , err_msg = 'imag part %s' % f )
4137
4128
4138
- @pytest .mark .xfail (IS_MUSL , reason = "gh23049" )
4139
4129
@pytest .mark .xfail (IS_WASM , reason = "doesn't work" )
4140
4130
def test_precisions_consistent (self ):
4141
4131
z = 1 + 1j
@@ -4146,7 +4136,6 @@ def test_precisions_consistent(self):
4146
4136
assert_almost_equal (fcf , fcd , decimal = 6 , err_msg = 'fch-fcd %s' % f )
4147
4137
assert_almost_equal (fcl , fcd , decimal = 15 , err_msg = 'fch-fcl %s' % f )
4148
4138
4149
- @pytest .mark .xfail (IS_MUSL , reason = "gh23049" )
4150
4139
@pytest .mark .xfail (IS_WASM , reason = "doesn't work" )
4151
4140
def test_branch_cuts (self ):
4152
4141
# check branch cuts and continuity on them
@@ -4173,7 +4162,6 @@ def test_branch_cuts(self):
4173
4162
_check_branch_cut (np .arccosh , [0 - 2j , 2j , 2 ], [1 , 1 , 1j ], 1 , 1 )
4174
4163
_check_branch_cut (np .arctanh , [0 - 2j , 2j , 0 ], [1 , 1 , 1j ], 1 , 1 )
4175
4164
4176
- @pytest .mark .xfail (IS_MUSL , reason = "gh23049" )
4177
4165
@pytest .mark .xfail (IS_WASM , reason = "doesn't work" )
4178
4166
def test_branch_cuts_complex64 (self ):
4179
4167
# check branch cuts and continuity on them
@@ -4227,7 +4215,6 @@ def test_against_cmath(self):
4227
4215
_glibc_older_than ("2.18" ),
4228
4216
reason = "Older glibc versions are imprecise (maybe passes with SIMD?)"
4229
4217
)
4230
- @pytest .mark .xfail (IS_MUSL , reason = "gh23049" )
4231
4218
@pytest .mark .xfail (IS_WASM , reason = "doesn't work" )
4232
4219
@pytest .mark .parametrize ('dtype' , [
4233
4220
np .complex64 , np .complex128 , np .clongdouble
0 commit comments