(self)
| 1583 | xi, y + y * 1j, nulp) |
| 1584 | |
| 1585 | def test_complex64_pass(self): |
| 1586 | nulp = 5 |
| 1587 | x = np.linspace(-20, 20, 50, dtype=np.float32) |
| 1588 | x = 10**x |
| 1589 | x = np.r_[-x, x] |
| 1590 | xi = x + x * 1j |
| 1591 | |
| 1592 | eps = np.finfo(x.dtype).eps |
| 1593 | y = x + x * eps * nulp / 2. |
| 1594 | assert_array_almost_equal_nulp(xi, x + y * 1j, nulp) |
| 1595 | assert_array_almost_equal_nulp(xi, y + x * 1j, nulp) |
| 1596 | y = x + x * eps * nulp / 4. |
| 1597 | assert_array_almost_equal_nulp(xi, y + y * 1j, nulp) |
| 1598 | |
| 1599 | epsneg = np.finfo(x.dtype).epsneg |
| 1600 | y = x - x * epsneg * nulp / 2. |
| 1601 | assert_array_almost_equal_nulp(xi, x + y * 1j, nulp) |
| 1602 | assert_array_almost_equal_nulp(xi, y + x * 1j, nulp) |
| 1603 | y = x - x * epsneg * nulp / 4. |
| 1604 | assert_array_almost_equal_nulp(xi, y + y * 1j, nulp) |
| 1605 | |
| 1606 | def test_complex64_fail(self): |
| 1607 | nulp = 5 |
nothing calls this directly
no test coverage detected