write(6,*) '초기값 x1='
read(5,*) x1
write(6,*) '초기값 x2='
read(5,*) x2
write(6,*) '수렴판정 조건 e='
read(5,*) e
n=0
write(3,*) ' n x(n) f(x) x(n+1)-x(n) '
write(3,*) '===================================================='
10 x=(x1*f(x2)-x2*f(x1))/(f(x2)-f(x1))
n=n+1
if(f(x2)*f(x).lt.0) then
write(3,30) n,x,f(x),abs(x1-x)
if(abs(x1-x).le.e) then
goto 20
end if
x1=x
else
write(3,30) n,x,f(x),abs(x2-x)
if(abs(x2-x).le.e) then
goto 20
end if
x2=x
end if
goto 10