forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*Do 6 Newton method iterations in cuberoot
Modified the cuberoot function to do 6 iterations with Newton's method, starting from the optimal first guess of (3/8)**(1/3). Following guidance from performance testing of the previous version, all convergence testing has been removed and the same number of iterations are applied regardless of the input value. The form of Newton's method used here does one division per iteration, but it is good at polishing the root to give an accurate final solution and by simply repeatedly using the same instructions it appears to optimize well. This commit changes answers at roundoff for code that uses the cuberoot function, so ideally this PR would be dealt with before the cuberoot becomes widely used.
- Loading branch information
1 parent
d7d126a
commit 3557f72
Showing
1 changed file
with
9 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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