I saw that I don't get answered when posting in other threads so I think it deserves a thread of its own :)
I was confused that in the example provided with the question, the function fails to find the root of lambda x : x2 (Which is obviosly 0). After a little research, I figured out it happens because you added the constrain that F(a) < 0 < F(b) or F(a) > 0 > F(b).
But in cases that the function is always possitive (like x2), you will always give up because of this. Even if the function does have a root!
Should we remove this constrain and have a different halting condition (I have thought about another one that in my opinion works better. My halting condition returns exactly the same answer as in the first example for lambda x : x-1, and return 0.0 for lambda x : x **2), or should we stick to your implementation because of your automatic tests?
(I didn't post here deatils about my halting condition so the stuff won't get mad that I give away information. If it is ok by the stuff, I would like to clarify myself by explaining my halting condition and why it works better).