A way to improve on the Euler method is to invoke the rhs of the ODE at mid point during each time step. This was done in the mid-point method via the Euler method over a half time interval ..
Another way to take into consideration the variation of the rhs over the time step is to average the rhs calculated at t and t+dt. The latter can be estimated based on a single Euler step to obtain the solution at t+dt. This leads to a prediction sub-step followed by a correction sub-step within each time step.
Solving
The Predictor-Corrector integrator step function using a function pointer is written as predictor_corrector_step.c
Exercise: Implement the 1D harmonic Oscillator in this scheme.