Text this: A robust algorithm for solving nonlinear system of equations using trust-region and line-search techniques