10000 Faster real_if_close. by anntzer · Pull Request #7489 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Faster real_if_close. #7489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2016
Merged

Faster real_if_close. #7489

merged 1 commit into from
Mar 31, 2016

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Mar 31, 2016

Because of the complexity of allclose, real_if_close(t) used to be
~2.5-3x slower than, say, t + t. This patch makes it approximately as
fast.

Because of the complexity of `allclose`, `real_if_close(t)` used to be
~2.5-3x slower than, say, `t + t`.  This patch makes it approximately as
fast.
@charris
Copy link
Member
charris commented Mar 31, 2016

This isn't quite right, there is also a default relative tolerance in allclose:

def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False):

EDIT: OK, it is set to zero for the current call. Hmm... I don't like that, but so it is.

@charris charris merged commit 2af06c8 into numpy:master Mar 31, 2016
@anntzer anntzer deleted the faster-real-if-close branch March 31, 2016 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0