def _quadmin(a, fa, fpa, b, fb):
 with np.errstate(divide='raise', over='raise', invalid='raise'):
  try:
   D = fa
   C = fpa
   db = (b - (a * 1.0))
   B = (((fb - D) - (C * db)) / (db * db))
   xmin = (a - (C / (2.0 * B)))
  except ArithmeticError:
   return None
 if (not np.isfinite(xmin)):
  return None
 return xmin

def _quadmin ( a , fa , fpa , b , fb ) : with np . errstate ( divide = 'raise' , over = 'raise' , invalid = 'raise' ) : try : D = fa C = fpa db = ( b - ( a * 1.0 ) ) B = ( ( ( fb - D ) - ( C * db ) ) / ( db * db ) ) xmin = ( a - ( C / ( 2.0 * B ) ) ) except ArithmeticError : return None if ( not np . isfinite ( xmin ) ) : return None return xmin
finds the minimizer for a quadratic polynomial that goes through the points .