quadfit Quadratic fit in high dimensions to find extremum (note - this is my first python code, and ugly as hell)