class_docstr: Solve f(x, *args) == 0 using Algorithm748 of Alefeld, Potro & Shi.
      
class_docstr_tok: ["Solve","f","(","x",",","*","args",")","==","0","using","Algorithm748","of","Alefeld",",","Potro","&","Shi","."]
docstr: Solve f(x) = 0 given an interval containing a zero.
docstr_tok: ["Solve","f","(","x",")","=","0","given","an","interval","containing","a","zero","."]
code: def solve(
      self,
      f,
      a,
      b,
      args=(),
      xtol=_xtol,
      rtol=_rtol,
      k=2,
      maxiter=_iter,
      disp=True,
  ):
      r"""Solve f(x) = 0 given an interval containing a zero."""
      self.configure(
          xtol=xtol, rtol=rtol, maxiter=maxiter, disp=disp, k=k
      )
      status, xn = self.start(f, a, b, args)
      if status == _ECONVERGED:
          return self.get_result(xn)
  
      # The first step only has two x-values.
      c = _secant(self.ab, self.fab)
      if not self.ab[0] < c < self.ab[1]:
          c = sum(self.ab) / 2.0
      fc = self._callf(c)
      if fc == 0:
          return self.get_result(c)
  
      self.d, self.fd = self._update_bracket(c, fc)
      self.e, self.fe = None, None
      self.iterations += 1
  
      while True:
          status, xn = self.iterate()
          if status == _ECONVERGED:
              return self.get_result(xn)
          if status == _ECONVERR:
              fmt = "Failed to converge after %d iterations, bracket is %s"
              if disp:
                  msg = fmt % (self.iterations + 1, self.ab)
                  raise RuntimeError(msg)
              return self.get_result(xn, _ECONVERR)
  
imports: import warnings
  from collections import namedtuple
  import operator
  from .None import _zeros
  import numpy
label_desc: Use image node_id 9 for calling the TOMS748Solver obj's underlying member method code with example usage: obj.solve(f, a, b, args, xtol, rtol, k, maxiter, disp) and returns: self, self, self, self