class_docstr: 1d-solver generating pairs of approximative root and error.
  
  Uses Illinois method or similar to find a root of f in [a, b].
  Might fail for multiple roots (needs sign change).
  Combines bisect with secant (improved regula falsi).
  
  The only difference between the methods is the scaling factor m, which is
  used to ensure convergence (you can choose one using the 'method' keyword):
  
  Illinois method ('illinois'):
      m = 0.5
  
  Pegasus method ('pegasus'):
      m = fb/(fb + fz)
  
  Anderson-Bjoerk method ('anderson'):
      m = 1 - fz/fb if positive else 0.5
  
  Pro:
  
  * converges very fast
  
  Contra:
  
  * has problems with multiple roots
  * needs sign change
class_docstr_tok: ["1d-solver","generating","pairs","of","approximative","root","and","error",".","Uses","Illinois","method","or","similar","to","find","a","root","of","f","in","[","a",",","b","]",".","Might","fail","for","multiple","roots","(","needs","sign","change",")",".","Combines","bisect","with","secant","(","improved","regula","falsi",")",".","The","only","difference","between","the","methods","is","the","scaling","factor","m",",","which","is","used","to","ensure","convergence","(","you","can","choose","one","using","the","'method","'","keyword",")",":","Illinois","method","(","'illinois","'",")",":","m","=","0.5","Pegasus","method","(","'pegasus","'",")",":","m","=","fb\/","(","fb","+","fz",")","Anderson-Bjoerk","method","(","'anderson","'",")",":","m","=","1","-","fz\/fb","if","positive","else","0.5","Pro",":","*","converges","very","fast","Contra",":","*","has","problems","with","multiple","roots","*","needs","sign","change"]
code: def __init__(self, ctx, f, x0, **kwargs):
      self.ctx = ctx
      if len(x0) != 2:
          raise ValueError(
              "expected interval of 2 points, got %i" % len(x0)
          )
      self.a = x0[0]
      self.b = x0[1]
      self.f = f
      self.tol = kwargs["tol"]
      self.verbose = kwargs["verbose"]
      self.method = kwargs.get("method", "illinois")
      self.getm = _getm(self.method)
      if self.verbose:
          print("using %s method" % self.method)
  
imports: from __future__ import print_function
  from copy import copy
  from ..libmp.backend import xrange
label_desc: Use image node_id 1 to create a new Illinois object  with example: obj = Illinois(ctx, f, x0)