program enshu11bf                             
implicitnone
real::x,y
real::dydx,x_new,verysmall
integer::n
x=20.0
verysmall=1.0e-6
don=1,99
callmy_kansuu_bibun(x,y,dydx)
x_new=x-y/dydx
write(*,*)n,x_new,abs(x_new-sqrt(2.0)),y
if(abs(x_new-x)<verysmall)exit
x=x_new
enddo
contains
subroutinemy_kansuu_bibun(z,f,dfdz)
real,intent(in)::z
real,intent(out)::f,dfdz
f=z**2-2.0
dfdz=2.0*z
endsubroutinemy_kansuu_bibun
endprogramenshu11bf