Off[General::spell1];
Clear[NewtonIte,f0,x0,delta,epsilon,max,d ];
NewtonIte[f0_,x0_,delta_,epsilon_,max_,d_] :=
Module[{f,k,small,cond},
  Set@@{f[x_],f0};
  p0 = x0;
  Y0 = N[f[p0],d];
  p1 = p0+1;
  k = 0;
  cond = 0;
  Print["p = ",N[p0,d],"\t   f[p] = ",
    N[Y0,d]];
  While[cond==0 && k < max,
    Df = N[f'[p0],d];
    If[Df==0, cond=1; Dp=p1-p0;p1=p0,
              Dp=Y0/Df;p1=p0-Dp];
    Y1 = N[f[p1],d];
    Print["p = ",N[p1,d],"\t   
      f[p] = ",N[Y1,d],
               "\t  |dp| <= ",N[Dp,d]];
    If[N[Abs[p1-p0],d] < delta,  
      cond=1];
    If[Abs[Y1]<epsilon, cond=1];
    If[RelErr<delta && Abs[Y1]<epsilon,  
        cond=1];
    p0 = p1;
    Y0 = Y1;
    k  = k+1;  ]; ];
  On[General::spell1];

Clear[f,x]; 
f[x_] = x Sin[x] - 1  ; 
Print["The function is f[x] = ",f[x]];  
Plot[f[x],{x,0,2},
PlotLabel->"The curve y = f(x)."];

NewtonIte[f[x],0.5,10^-10,10^-10,10,8 ]

Clear[f,x]; 
f[x_] = 15(1 - Exp[-x/10]) - x;
Print["The function is f[x] = ",f[x]]; 
Plot[f[x],{x,0,9},
PlotLabel->"The curve y = f(x)."];

NewtonIte[f[x],8.0,10^-10,10^-10,10,8]

Clear[f,x]; 
f[x_] = (x -1)^8;

NewtonIte[f[x],1.1,10^-10,10^-10,100,8]

Off[General::spell1];
Clear[NewtonIte2,f0,x0,delta,max,d ];
NewtonIte2[f0_,x0_,delta_,max_,d_] :=
Module[{f,k,small,cond},
  Set@@{f[x_],f0};
  p0 = x0;
  Y0 = N[f[p0],d];
  p1 = p0+1;
  k = 0;
  cond = 0;
  Print["p = ",N[p0,d],"\t   f[p] = ",
    N[Y0,d]];
  While[cond==0 && k < max,
    Df = N[f'[p0],d];
    If[Df==0, cond=1; Dp=p1-p0;p1=p0,
              Dp=Y0/Df;p1=p0-Dp];
    Y1 = N[f[p1],d];
    Print["p = ",N[p1,d],"\t   
      f[p] = ",N[Y1,d],
               "\t  |dp| <= ",N[Dp,d]];
    If[N[Abs[p1-p0],d] < delta,  
      cond=1];
    If[RelErr<delta,cond=1];
    p0 = p1;
    Y0 = Y1;
    k  = k+1;  ]; ];
  On[General::spell1];

Clear[f,x]; 
f[x_] = (x -1)^12;

NewtonIte2[f[x],1.1,10^-6, 50,8]