| 4177 | _check_branch_cut(np.arctanh, [0-2j, 2j, 0], [1, 1, 1j], 1, 1, False, np.complex64) |
| 4178 | |
| 4179 | def test_against_cmath(self): |
| 4180 | import cmath |
| 4181 | |
| 4182 | points = [-1-1j, -1+1j, +1-1j, +1+1j] |
| 4183 | name_map = {'arcsin': 'asin', 'arccos': 'acos', 'arctan': 'atan', |
| 4184 | 'arcsinh': 'asinh', 'arccosh': 'acosh', 'arctanh': 'atanh'} |
| 4185 | atol = 4*np.finfo(complex).eps |
| 4186 | for func in self.funcs: |
| 4187 | fname = func.__name__.split('.')[-1] |
| 4188 | cname = name_map.get(fname, fname) |
| 4189 | try: |
| 4190 | cfunc = getattr(cmath, cname) |
| 4191 | except AttributeError: |
| 4192 | continue |
| 4193 | for p in points: |
| 4194 | a = complex(func(np.complex_(p))) |
| 4195 | b = cfunc(p) |
| 4196 | assert_( |
| 4197 | abs(a - b) < atol, |
| 4198 | "%s %s: %s; cmath: %s" % (fname, p, a, b) |
| 4199 | ) |
| 4200 | |
| 4201 | @pytest.mark.xfail( |
| 4202 | # manylinux2014 uses glibc2.17 |