(self)
| 410 | assert vabs == data |
| 411 | |
| 412 | def test_sqrt(self): |
| 413 | pinf, ninf, nan = self._pinfinity(), self._ninfinity(), self._nan() |
| 414 | data = self._data() |
| 415 | vdata = self.load(self._data()) |
| 416 | |
| 417 | sqrt_cases = ((-0.0, -0.0), (0.0, 0.0), (-1.0, nan), (ninf, nan), (pinf, pinf)) |
| 418 | for case, desired in sqrt_cases: |
| 419 | data_sqrt = [desired] * self.nlanes |
| 420 | sqrt = self.sqrt(self.setall(case)) |
| 421 | assert sqrt == pytest.approx(data_sqrt, nan_ok=True) |
| 422 | |
| 423 | # load to truncate precision |
| 424 | data_sqrt = self.load([math.sqrt(x) for x in data]) |
| 425 | sqrt = self.sqrt(vdata) |
| 426 | assert sqrt == data_sqrt |
| 427 | |
| 428 | def test_square(self): |
| 429 | pinf, ninf, nan = self._pinfinity(), self._ninfinity(), self._nan() |
nothing calls this directly
no test coverage detected