Did it with four IFs, seven assignments, and two simple mathematical operations. I dare you to do better, I DOUBLE DARE YOU, CODEHACKER!
Seriously, bisection method is more than enough for this one. Skynet: the Virus have given me much more pain.
P.S. Am I qualified to be batman now? ^_^