is questionable. abs() of an expression can only equal 0 if the value itself is 0, in which case there would be no point in taking abs():
However, with polynomials, numeric round-off error is a common problem (which gets worse with higher degree), so it might not be possible to find an f(x(j)) that is exactly 0. Instead you might get to the point of finding two numbers that are adjacent in floating point representation such that f() of one of them is on one side of 0 and f() of the other of them is on the other side of 0 -- for example 1.834e-34 and -9.5192e-35 . Therefore instead of testing for exactly 0, you should test that the absolute value is less than a tolerance.