finding roots of equations