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

Floating-point underflow in root-finding functions #57

Closed
UnkindPartition opened this issue Dec 29, 2020 · 1 comment
Closed

Floating-point underflow in root-finding functions #57

UnkindPartition opened this issue Dec 29, 2020 · 1 comment
Assignees

Comments

@UnkindPartition
Copy link
Contributor

Root-finding functions like arkRootfind and cvRootfind use floating-point multiplication to check whether a sign change has occurred. This is prone to floating-point underflow (e.g. (-1e-166) * 1e-166 evaluates to 0) which makes the algorithm assume that the sign change was on the wrong sub-interval.

Here's a commit fixing this issue for cvode and arkode; feel free to pull it into sundials if you find it useful. The fix may need to be ported to other packages as well.

Thanks for maintaining sundials!

@balos1 balos1 added the bug label Aug 24, 2021
@balos1 balos1 self-assigned this Aug 24, 2021
@balos1 balos1 added enhancement and removed bug labels Sep 7, 2022
@eltix
Copy link

eltix commented Nov 25, 2022

@balos1 Any chance this can be merged upstream? Do you want us to open a PR?

Thanks for maintaining Sundials :)

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

No branches or pull requests

4 participants