      real y(1),value,t,tout,relerr,abserr,reroot,aeroot
      external f,g
      common value
      y(1) = 1.0d0
      t = 0.0d0
      tout = 10.0d0
      relerr = 1.e-5
      abserr = 1.e-5
      iflag = 1
      reroot = 1.e-4
      aeroot = 1.e-4
      print 110
      do 50 i=1,10
      value = float(i) + 1.0
      call deroot(f,1,y,t,tout,relerr,abserr,iflag,g,reroot,aeroot)
      print 100,iflag,t,y(1)
   50 continue
  100 format(i4,1p2e13.5)
  110 format(1h1)
      stop
      end
      subroutine f(t,y,yp)
      real t,y(1),yp(1)
      yp(1) = y(1)
      return
      end
      real function g(t,y,yp)
      real t,y(1),yp(1),value
      common value
      g = y(1) - value
      return
      end