Finding the root of a polynomial
I can find the root of a polinomial in a segment [A,B]. I can find it if root == A, root == B or if root is between A and B. And all of this using 2 methods not one.
But for the life of me I cannot determine if the root is not in the segment. For example, let's say that the polynomial is a simple one The root is obviously 5. But if A and B are both bigger (A=10, B=14) or both smaller (A=-1, B=4) than the root (5 here), then I am stuck!! :(
EDIT: EUREKA!!! I figured it out. If both A and B are of the same sign (both positive or negative) than the root simply isn't in the segment [A,B].
EDIT 2: IDIOT!!! why shouldn't A and B be both positive, A= 3, B=10. A and B don't matter. There values once inputed in the polynomial matter.
so if we transform into then f(A) and f(B) must be of the same sign.