class_docstr: 1d-solver generating pairs of approximative root and error.
  
  Needs a starting point x0 close to the root.
  Uses Halley's method with cubic convergence rate.
  
  Pro:
  
  * converges even faster the Newton's method
  * useful when computing with *many* digits
  
  Contra:
  
  * needs first and second derivative of f
  * 3 function evaluations per iteration
  * converges slowly for multiple roots
class_docstr_tok: ["1d-solver","generating","pairs","of","approximative","root","and","error",".","Needs","a","starting","point","x0","close","to","the","root",".","Uses","Halley","'s","method","with","cubic","convergence","rate",".","Pro",":","*","converges","even","faster","the","Newton","'s","method","*","useful","when","computing","with","*","many","*","digits","Contra",":","*","needs","first","and","second","derivative","of","f","*","3","function","evaluations","per","iteration","*","converges","slowly","for","multiple","roots"]
code: def __iter__(self):
      x = self.x0
      f = self.f
      df = self.df
      d2f = self.d2f
      while True:
          prevx = x
          fx = f(x)
          dfx = df(x)
          d2fx = d2f(x)
          x -= 2 * fx * dfx / (2 * dfx**2 - fx * d2fx)
          error = abs(x - prevx)
          yield x, 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 Halley obj's underlying member method code with example usage: obj.__iter__() without return types