BUG: Issue #4464 Fixed residuez which failed for Complex Numbers#8360
Open
deepakgouda wants to merge 3 commits intoscipy:mainfrom
Open
BUG: Issue #4464 Fixed residuez which failed for Complex Numbers#8360deepakgouda wants to merge 3 commits intoscipy:mainfrom
deepakgouda wants to merge 3 commits intoscipy:mainfrom
Conversation
Contributor
Author
|
@eric-wieser Could you please give any suggestions regarding the fix? Except for rounding off upto the tolerance bit, I wasn't able to come up with a solution. |
eric-wieser
suggested changes
Feb 13, 2018
Contributor
eric-wieser
left a comment
There was a problem hiding this comment.
This needs tests, and they need to be tests that failed before this change. The approach still feels bad to me, but I can't say I understand the problem yet either. Seeing tests would help with that.
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.
Fixed the bug in issue #4464
The function raised a TypeError:
To fix it, I fixed the polydiv function in
numpy/lib/polynomial.py. I created a PR in numpy repo.Further, in cases with repeated roots, the obtained roots were of the form 0.9999998 and 1.000001. These were treated as two different roots with multiplicity 1 each. This led to wrong values of the residue. I rounded them off to
-log(tol)decimal digits i.e. the exponent value oftol. This gives the correct answer.