An optimized wave equation for seismic modeling and reverse time migration