Solving nonlinear equations by adaptive homotopy continuation