Repository navigation
Conversation
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The complex arctangent quotient loses the signed real zero on its branch cut and is undefined at the poles. An array containing
2jreturns the wrong real branch;1jreturns NaNs:Use
std::atanfor complex inputs whose real component is zero, preserving the principal branch and pole values. The other complex-input path keeps its existing arithmetic. Adds signed-zero/component assertions, both poles, strided arrays, execution-block crossings and aliased outputs; includes a release note.The exact new method fails on the baseline and passes on the built extension with one and four threads. The full native
numexpr.test()suite passes all 6,042 cases and project hooks pass. In 72 recorded-spectrum expressions checked against scalarcmath.atan, 70,728 incorrect bins become zero; all 18 ordinary off-axis control hashes are unchanged. This verifies expression values, without an acoustic-quality claim.The independent square-root patch in #581 does not fix this arctangent path; its native head reproduces the same errors. Tested on Linux/Python 3.12 with NumPy 2.5.4 and the non-VML kernel. Other platforms and VML were not tested.