Skip to content
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

Some coefficient combinations cause solver to hang #6

Open
borismus opened this issue Jul 27, 2017 · 3 comments
Open

Some coefficient combinations cause solver to hang #6

borismus opened this issue Jul 27, 2017 · 3 comments

Comments

@borismus
Copy link

I haven't been able to track down exactly when this happens, but some coefficient arrays cause it to spin forever. For example [1, 0, 0] will do it, even though the solution should be x=0.

@rreusser
Copy link
Member

Overall I think durand-kerner is probably a more robust (and certainly faster) method for this. I've had pretty good luck with it.

@borismus
Copy link
Author

Thanks for the pointer (and the library in the first place). If this fails so clearly in such simple cases, might be worth considering pointing more prominently to durand-kerner, or providing more caveats.

@rreusser
Copy link
Member

rreusser commented Aug 16, 2017

After a bit of digging, it seems like the problem is when the cauchy approximation returns a radius of exactly zero. It doesn't simply shift things over when deflating and gets into a loop. Likely culprit: reworking the logic to avoid goto/label in the js when translating goto-style fortran loops. 😑

For now, I've just replaced the readme with a deprecation warning and a pointer to durand-kerner, which is at the very least significantly faster and more robust. It didn't always succeed in separating nearby roots, but I have no reason to believe lowering the tolerance wouldn't trivially solve that.

Thanks for raising this though. Leaving it open for now. I'd be glad to get this working better, but it probably won't happen too soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants