It’s not. Increase the duration to 20,000 and you see a classic gaming bug of the momentum going haywire eventually. Unsure if it’s anything to do with the environment or the coding. On mobile so can’t really analyze it.
Well, even if the math is correct, the simulation will be lossy if one works with finite precision. And because of the chaotic nature of the double pendulum, small errors will eventually add up to big deviations.