AnyarInc / Ascent

A fast and flexible C++ simulation engine and differential equation solver.
Apache License 2.0
125 stars 15 forks source link

Extended (80-bit) precision (feature request) #16

Open dietmarwo opened 3 years ago

dietmarwo commented 3 years ago

Would be nice if Ascent could support 80-bit precision as https://github.com/bluescarni/heyoka already does.

From https://arxiv.org/abs/2105.00800 :

"Although traditionally double precision has been considered enough for high-precision applica- tions in astrodynamics and celestial mechanics, in recent times our understanding of the physics of the Solar System has progressed to the point that the use of double-precision arithmetic can become the limiting factor in achieving the desired level of accuracy"

There is an ongoing competition https://kelvins.esa.int/space-debris-the-origin/challenge/ where I think Ascent is a good alternative to Heyoka, but possibly requires high accuracy (30 years orbit propagation).

stephenberry commented 3 years ago

Thanks for pointing out heyoka, it looks like a neat library. There are a number of higher precision libraries (up to 128bit quad precision) that I don't think would be difficult to use with Ascent, but I haven't tried, and I'm not sure which one would be best to implement.

That is an interesting competition. I have run high order Taylor solvers (like heyoka) in the past and I can see their appeal for this problem, but I feel like a custom implicit solver would be a better approach for this kind of problem where the equations are all known.

If you try to tackle this problem with Ascent I would be happy to give feedback. Another option is looking into boost's odeint implicit solvers.

Do you have any idea of how heyoka implements 128bit floating point support?

stephenberry commented 3 years ago

On clang and gcc you can you long double and it will be 80bit, on MSVC it is only 64bit

stephenberry commented 3 years ago

Ascent integrators are templated, so you should be able to use the real128 type in https://github.com/bluescarni/mppp (this is the library that heyoka uses)