def _minimize_scalar_brent(func, brack=None, args=(), xtol=1.48e-08, maxiter=500, **unknown_options):
 _check_unknown_options(unknown_options)
 tol = xtol
 if (tol < 0):
  raise ValueError(('tolerance should be >= 0, got %r' % tol))
 brent = Brent(func=func, args=args, tol=tol, full_output=True, maxiter=maxiter)
 brent.set_bracket(brack)
 brent.optimize()
 (x, fval, nit, nfev) = brent.get_result(full_output=True)
 return OptimizeResult(fun=fval, x=x, nit=nit, nfev=nfev, success=(nit < maxiter))

def _minimize_scalar_brent ( func , brack = None , args = ( ) , xtol = 1.48e-08 , maxiter = 500 , ** unknown_options ) : _check_unknown_options ( unknown_options ) tol = xtol if ( tol < 0 ) : raise ValueError ( ( 'tolerance should be >= 0, got %r' % tol ) ) brent = Brent ( func = func , args = args , tol = tol , full_output = True , maxiter = maxiter ) brent . set_bracket ( brack ) brent . optimize ( ) ( x , fval , nit , nfev ) = brent . get_result ( full_output = True ) return OptimizeResult ( fun = fval , x = x , nit = nit , nfev = nfev , success = ( nit < maxiter ) )
options maxiter : int maximum number of iterations to perform .