(self)
| 561 | assert simd == pytest.approx(data, nan_ok=True) |
| 562 | |
| 563 | def test_reciprocal(self): |
| 564 | pinf, ninf, nan = self._pinfinity(), self._ninfinity(), self._nan() |
| 565 | data = self._data() |
| 566 | vdata = self.load(self._data()) |
| 567 | |
| 568 | recip_cases = ((nan, nan), (pinf, 0.0), (ninf, -0.0), (0.0, pinf), (-0.0, ninf)) |
| 569 | for case, desired in recip_cases: |
| 570 | data_recip = [desired] * self.nlanes |
| 571 | recip = self.recip(self.setall(case)) |
| 572 | assert recip == pytest.approx(data_recip, nan_ok=True) |
| 573 | |
| 574 | data_recip = self.load([1 / x for x in data]) # load to truncate precision |
| 575 | recip = self.recip(vdata) |
| 576 | assert recip == data_recip |
| 577 | |
| 578 | def test_special_cases(self): |
| 579 | """ |
nothing calls this directly
no test coverage detected