subroutine muller(x0, x1, x2, eps, iter, rad, kod)
! Metoda Muller
integer width

if(kod /=0) then
print '(/, a, t14, a, :, t29, a, t44)', ' Iteratia', 'x'
write(1, '(a, t14, a, :, t29, a, t44)') ' Iteratia', 'x'
endif
lnit =iter

iter =0

1	iter =iter +1
c =f(x2)

f10 =DivDif2(x0,x1)     !(f(x0)-f(x1))/(x0-x1)
f02 =DivDif2(x0,x2)  
f21 =DivDif2(x1,x2)

b =f21 +f02 -f10

a =(f10 -f21)/(x0-x2)

!write(1,*) 'a b c:', a,b,c
delta2 =b**2-4*a*c

if(delta2 <0) then
print*, 'delta =', delta2
write(1,*) 'delta =', delta2
rad =x2
kod =-1
return
endif

if(b >=0) then
x3 =x2 -2*c/(b+sqrt(b**2-4*a*c))
else
x3 =x2 -2*c/(b-sqrt(b**2-4*a*c))
endif


if(kod /=0) then
iwiter =width(iter)
write(*, '(1x, I<iwiter>, t11, g15.7, :, t26, g15.7)') iter, x3
write(1, '(1x, I<iwiter>, t11, g15.7, :, t26, g15.7)') iter, x3
endif


if(abs(x3-x2) <= eps) then
rad=x3
lnit =iter
kod =0
return

else
call select(x0, x1, x2, x3)
endif

if(iter <lnit) then
goto 1
else
rad =x3
kod =1
endif

end

