sxs-collaboration / spectre

SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
https://spectre-code.org
Other
154 stars 187 forks source link

Improve maximum CCE precision #1609

Open moxcodes opened 5 years ago

moxcodes commented 5 years ago

Feature request:

The maximum CCE precision in both the standard and regularity-preserving formulations is limited by expressions involving values near unity and values small during the CCE evolution, for instance 1 - sqrt(1 - j j_bar), where j is small. Note that the result here is also small, but the precision is limited by the form of the expression. Note that for a typical run j~10^{-4}, so the loss of precision here is not a dire problem

There are two possible routes to fix these computations and achieve better precision, both involving reformulation:

teukolsky commented 4 years ago

I think you meant multiply by 1 + sqrt(1-j jbar) in numerator and denominator. As a matter of technique, it's probably a good idea to always code things this way cf. roots of a quadratic.