FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: np.tan(np.inf) test failure by charris · Pull Request #19994 · numpy/numpy · GitHub

/ numpy Public

BUG: np.tan(np.inf) test failure - #19994

Merged
charris merged 1 commit into
numpy:maintenance/1.21.xfrom
charris:backport-19974
Sep 29, 2021
Merged

charris merged 1 commit into
numpy:maintenance/1.21.xfrom
charris:backport-19974

Conversation

charris commented Sep 28, 2021

Copy link
Copy Markdown
Member

Backport of #19974.

Numpy has a test failure where np.tan(np.inf) is not raising "invalid". The bug is due to an underlying bug in Apple's Libm. The bug is only present on arm64 and does not affect x86_64.

The changes here apply to sin, cos, and tan. If the input is a non-finite value, then return (x - x), which will raise "invalid" for x=INFINITY as well as return NAN for both INFINITY and NAN as input.

Testing:
(Note, the testing below is on top of another branch that fixes divide-by-zero failures in reciprocal)

Before change:

FAILED numpy/core/tests/test_umath.py::TestSpecialFloats::test_tan - AssertionError: FloatingPointError not raised by tan
1 failed, 15589 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 70.99s (0:01:10)

After change:

15590 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 71.38s (0:01:11)

Numpy has a test failure where `np.tan(np.inf)` is not raising "invalid". The bug is due to an underlying bug in Apple's Libm.  The bug is only present on arm64 and does not affect x86_64.

The changes here apply to sin, cos, and tan. If the input is a non-finite value, then return `(x - x)`, which will raise "invalid" for `x=INFINITY` as well as return `NAN` for both `INFINITY` and `NAN` as input.

Testing:
(Note, the testing below is on top of another branch that fixes divide-by-zero failures in reciprocal)

Before change:
```
FAILED numpy/core/tests/test_umath.py::TestSpecialFloats::test_tan - AssertionError: FloatingPointError not raised by tan
1 failed, 15589 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 70.99s (0:01:10)
```

After change:
```
15590 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 71.38s (0:01:11)
```
charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Sep 28, 2021
charris added this to the 1.21.3 release milestone Sep 28, 2021
charris merged commit c3de0e6 into numpy:maintenance/1.21.x Sep 29, 2021
charris deleted the backport-19974 branch November 27, 2021 20:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL