Add functions for argument reduction
eggrobin opened this issue · 1 comments
Currently we have
- A reduction to ]-π/2, π/2[,
Principia/numerics/elliptic_integrals.cpp
Lines 116 to 120 in 90904e3
- Many reductions to [0, 2π[,
Principia/astronomy/orbital_elements_body.hpp
Line 461 in 90904e3
some of them with preconditions,
Principia/physics/kepler_orbit_body.hpp
Lines 166 to 169 in 90904e3
one slightly better one seemingly used only in tests,
Principia/numerics/double_precision_body.hpp
Lines 309 to 316 in 90904e3
None of those are correctly rounded, and we keep writing more of that kind of thing (most recently in #3761 (comment)), there reducing to ]-π, π[.
We should centralize the angle reduction functions somewhere in numerics (and make them correctly rounded someday, see #1760).