Commit 17f1c40
committed
Cuberoot: Apply first iteration explicitly (mom-ocean#11)
Applying the first iteration explicitly appears to speed up the cuberoot
function by a bit over 20%:
Before:
Halley Final: 0.14174999999999999
After:
Halley Final: 0.11080000000000001
There is an assumption that compilers will precompute the constants like
`0.7 * (0.7)**3`, and that all will do so in the same manner.1 parent 4813b17 commit 17f1c40
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
0 commit comments