A Jacobi-like acceleration for dynamic programming