class_docstr: 1d-solver generating pairs of approximative root and error.
  
  Needs starting points x0, x1 and x2 close to the root.
  x1 defaults to x0 + 0.25; x2 to x1 + 0.25.
  Uses Muller's method that converges towards complex roots.
  
  Pro:
  
  * converges fast (somewhat faster than secant)
  * can find complex roots
  
  Contra:
  
  * converges slowly for multiple roots
  * may have complex values for real starting points and real roots
  
  http://en.wikipedia.org/wiki/Muller's_method
class_docstr_tok: ["1d-solver","generating","pairs","of","approximative","root","and","error",".","Needs","starting","points","x0",",","x1","and","x2","close","to","the","root",".","x1","defaults","to","x0","+","0.25",";","x2","to","x1","+","0.25",".","Uses","Muller","'s","method","that","converges","towards","complex","roots",".","Pro",":","*","converges","fast","(","somewhat","faster","than","secant",")","*","can","find","complex","roots","Contra",":","*","converges","slowly","for","multiple","roots","*","may","have","complex","values","for","real","starting","points","and","real","roots","http",":","\/\/en.wikipedia.org\/wiki\/Muller's_method"]
code: def __iter__(self):
      f = self.f
      x0 = self.x0
      x1 = self.x1
      x2 = self.x2
      fx0 = f(x0)
      fx1 = f(x1)
      fx2 = f(x2)
      while True:
          # TODO: maybe refactoring with function for divided differences
          # calculate divided differences
          fx2x1 = (fx1 - fx2) / (x1 - x2)
          fx2x0 = (fx0 - fx2) / (x0 - x2)
          fx1x0 = (fx0 - fx1) / (x0 - x1)
          w = fx2x1 + fx2x0 - fx1x0
          fx2x1x0 = (fx1x0 - fx2x1) / (x0 - x2)
          if w == 0 and fx2x1x0 == 0:
              if self.verbose:
                  print("canceled with")
                  print("x0 =", x0, ", x1 =", x1, "and x2 =", x2)
              break
          x0 = x1
          fx0 = fx1
          x1 = x2
          fx1 = fx2
          # denominator should be as large as possible => choose sign
          r = self.ctx.sqrt(w**2 - 4 * fx2 * fx2x1x0)
          if abs(w - r) > abs(w + r):
              r = -r
          x2 -= 2 * fx2 / (w + r)
          fx2 = f(x2)
          error = abs(x2 - x1)
          yield x2, error
  
imports: from __future__ import print_function
  from copy import copy
  from ..libmp.backend import xrange
label_desc: Use image node_id 2 for calling the Muller obj's underlying member method code with example usage: obj.__iter__() without return types