subroutine func(x, fx, dfx) c c -- the solution to f(x) = sin(x) - x/10 c real x, fx, dfx, small data small/1.0e-5/ c if (abs(x) .lt. small) goto 10 fx = sin(x) - 0.1 * x dfx = cos(x) - 0.1 return 10 fx = x - 0.1 * x dfx = 1 - 0.1 return end