https://5dok.org/document/6qmpvg9q-efficient-speed-profiles-finite-shift-multi-phase-optimization.html