class_docstr: 1d-solver generating pairs of approximative root and error.
  
  Needs starting points x0 close to the root.
  
  Pro:
  
  * converges fast
  * sometimes more robust than secant with bad second starting point
  
  Contra:
  
  * converges slowly for multiple roots
  * needs first derivative
  * 2 function evaluations per iteration
class_docstr_tok: ["1d-solver","generating","pairs","of","approximative","root","and","error",".","Needs","starting","points","x0","close","to","the","root",".","Pro",":","*","converges","fast","*","sometimes","more","robust","than","secant","with","bad","second","starting","point","Contra",":","*","converges","slowly","for","multiple","roots","*","needs","first","derivative","*","2","function","evaluations","per","iteration"]
code: def __init__(self, ctx, f, x0, **kwargs):
      self.ctx = ctx
      if len(x0) == 1:
          self.x0 = x0[0]
      else:
          raise ValueError(
              "expected 1 starting point, got %i" % len(x0)
          )
      self.f = f
      if not "df" in kwargs:
  
          def df(x):
              return self.ctx.diff(f, x)
  
      else:
          df = kwargs["df"]
      self.df = df
  
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 Newton object  with example: obj = Newton(ctx, f, x0)