An adaptive optimized Runge-Kutta-Nyström method for second-order IVPs