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

bugfix in gauss for large n #111

Merged
merged 2 commits into from
Jul 26, 2024
Merged

bugfix in gauss for large n #111

merged 2 commits into from
Jul 26, 2024

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented Jul 26, 2024

Should fix #109.

Our arbitrary-precision eigensolver works by Newton's method on $\det(J - \lambda I)$ where $J$ is the Jacobi matrix, but the problem is that the determinant calculation easily underflows. However, since what we actually want is only the ratio $\det(J - \lambda I) / \det'(J - \lambda I)$ (the Newton step), we can rescale to this ratio at each step of the tridiagonal-determinant iteration to suppress under/ovrerflow.

On a separate note, the Newton iteration was missing the break statement on the convergence check, so it was taking 1000x longer than necessary!

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (d5bbb69) to head (a529373).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #111   +/-   ##
=======================================
  Coverage   98.53%   98.54%           
=======================================
  Files           7        7           
  Lines         682      686    +4     
=======================================
+ Hits          672      676    +4     
  Misses         10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevengj stevengj merged commit bb53bea into master Jul 26, 2024
10 checks passed
@stevengj stevengj deleted the gaussfix branch July 26, 2024 19:49
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

Successfully merging this pull request may close these issues.

gauss incorrect for large n
1 participant