I have to write the Newton's method in the point which is the mean of Interval. and in 'While' loop it could be while the function(point)>eps.

point = Mean[inter];

step[f_,inter_] := Module[{p:=Mean@First@(List @@ inter)},

IntervalIntersection[inter, p - (f[p])/(f'[p])]]

newton[f_, inter0_, eps_] := Module[{iter = 0},

Print["X1 = ", N@Mean@First@(List @@

NestWhile[(++iter; step[f, #]) &, inter0,

Abs[f[p]] > eps & ])];

Print["iter=", iter];

Print[ "loop counts: ", iter, ". ", inter,"; p=",p=Mean@First@(List @@ inter), "; f[p]=",f[p],"; f'[p]=",f'[p]]];

f[x_] := x*x - 8*x + 7;

inter := Interval[{5,9}];

newton[f, inter, 0.00001];

I tried to do it, but it doesn't work correctly. Please, help me!