scipy-independent quartic minimization