finds real roots of a cubic equation:
coeffs[0]*x^3 + coeffs[1]*x^2 + coeffs[2]*x + coeffs[3] = 0
(if coeffs is 4-element vector)
or
x^3 + coeffs[0]*x^2 + coeffs[1]*x + coeffs[2] = 0
(if coeffs is 3-element vector)


the number of real roots found