# Why is velocity Verlet better than Verlet for gravity if it has a worse order of magnitude for the error term

Even though this method is more widely used than the simple Verlet method mentioned above, it unfortunately has an error term of O(Δt^2) , which is two orders of magnitude worse. That said, if you want to have a simulation with many objects that depend on one another --- like a gravity simulation --- the Velocity Verlet algorithm is a handy choice;

I found that here and the site doesn't offer any explanation on why this would be the case. Apparently the advantage over the Verlet, that the velocity Verlet, has to offer is that it can calculate the velocity and the position but I don't see how that helps. I haven't found any other sources that help either.

So if you compute the sequence $$x_k$$ with the Verlet formula with a good value for $$x_1$$, and compare with an exact solution $$x(t)$$, setting $$e_k=x_k-x(t_k)$$, then $$e_{k+1}-2e_k+e_{k-1}=U(\Delta t^4),\\ e_{k+1}-e_k=O(Δt^3),\\ e_k=O(Δt^2).$$ So if you compute $$v_k=\dfrac{x_{k+1}-x_{k-1}}{2Δt},$$ then its error is still 2nd order.
The combination of the 2nd order midpoint and Heun methods in the velocity Verlet method is again 2nd order, giving the same values as the above method. Its advantage is that it is a little more robust against accumulation of floating-point noise at small step sizes, the (relative) floating-point error term changing from $$\sim\frac{\mu}{Δt^2}$$ to $$\sim\frac{\mu}{Δt}$$, where $$\mu$$ is the machine constant representing the floating-point precision.