Brent Root Finding Python Version