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 loop but not the slower one, or something like that? Or is it that specifically the divisions are too many and too expensive? Or the N_it-1 extra evaluations of sincos?
This is pretty notable isn't it? This is the first exact, non-series solution (?) of a very famous equation from orbital mechanics, that was first posed 400+ years ago.
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, nobody cares about exactness itself.
conistonwater|4 years ago
titzer|4 years ago
perihelions|4 years ago
https://en.wikipedia.org/wiki/Kepler%27s_equation
The work this builds on was discussed here (121 comments):
https://news.ycombinator.com/item?id=25375575
conistonwater|4 years ago
mseri|4 years ago
The link is also on the arxiv page but a bit hidden.
asplake|4 years ago