top | item 26655939

Kepler's Goat Herd: An Exact Solution for Elliptical Orbit Evolution

57 points| mkoc | 4 years ago |arxiv.org

12 comments

order

conistonwater|4 years ago

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?

titzer|4 years ago

I see a lot of sin's and cos's in both of those, and SSE and AVX don't have either of these operations for vectors. So I doubt it is that.

perihelions|4 years ago

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.

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

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.