I wonder how it happened that the inner loop here ( https://github.com/oliverphilcox/Keplers-Goat-Herd/blob/3a0b... ) with N_it=5 is 2 times slower than the inner loop here ( https://github.com/oliverphilcox/Keplers-Goat-Herd/blob/3a0b... ) with N_it=18. It doesn't look two times faster at all, and I've spent a lot of time optimizing numerical code. Is it possible that the compiler managed to vectorize the faster loo…
Kepler's Goat Herd: An Exact Solution for Elliptical Orbit Evolution
11–13 of 13 posts
Re: Kepler's Goat Herd: An Exact Solution for Elliptical Orbit Evolution
#12Earlier quoted context omitted.
In numerical code the distinction between exact closed-form solutions and approximate solutions (through Newton's method and the like) is just not that meaningful. What determines speed is how much arithmetic you have to do, and it's quite possible to have a closed-form solution that is too cumbersome to evaluate compared to an approximate method. After all, approximate methods only have to converge to tolerance, nob…
Yes, well put. I'd take it further - in numerical code there is no real distinction /at all/ between closed form vs iterative solutions. Every type of numerical code is subject to truncation error; an iterative method with few moving parts may systematically converge to a more accurate result than the direct expression of a closed-form solution. It's quite interesting to delve into how special functions like `sin` an…
This assertion is however wrong. Closed form solutions at worse accumulate rounding errors of a single expression, while iterative solutions not only pile on rounding errors throughout the iterations but they also have to stop by truncating the rest of the solution, leading to results which not only is approximate but also amplifies rounding errors.
Re: Kepler's Goat Herd: An Exact Solution for Elliptical Orbit Evolution
#13Earlier quoted context omitted.
Yes, well put. I'd take it further - in numerical code there is no real distinction /at all/ between closed form vs iterative solutions. Every type of numerical code is subject to truncation error; an iterative method with few moving parts may systematically converge to a more accurate result than the direct expression of a closed-form solution. It's quite interesting to delve into how special functions like `sin` an…
> I'd take it further - in numerical code there is no real distinction /at all/ between closed form vs iterative solutions. This assertion is however wrong. Closed form solutions at worse accumulate rounding errors of a single expression, while iterative solutions not only pile on rounding errors throughout the iterations but they also have to stop by truncating the rest of the solution, leading to results which not…