#362: Improve roundoff accuracy of efficient RK4 -------------------------+-------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: new Priority: major | Milestone: Component: Cactus | Version: Keywords: | -------------------------+-------------------------------------------------- I just encountered a weird case where evolving Minkowski with the efficient RK4 implementation was not static. It turns out that the reason was floating-point round-off error in RK4. During each of the substeps, RK4 adds terms with factors of 1/3 and 2/3, and for the final step, adds a term with a factor of 4/3. Due to round-off, these terms do not cancel exactly, so that the time-evolved lapse is slightly different from 1 (although all the lapse RHS terms are 0). The same goes for the diagonal terms of the metric.
The attached patch keeps track of the round-off error when adding these terms, leading to a more accurate integration result.
The problem described above is not always visible, but also depends on optimisation settings.