Imported from https://github.com/mathbarre/PerformanceEstimationPolyakSteps