Highly stable numerical methods for second order differential equations