I need to implement this in Fortran:
do i = 1,n xstar = solve(f(x,i),x1,x2) end do
solve and f are functions. I need to call solve