finding mid value
x = ( left + right ) / 2.0 NEW_LINE value = f ( x , p , num ) NEW_LINE prime = f_prime ( x , p ) NEW_LINE if ( value * prime <= 0 ) : NEW_LINE INDENT left = x NEW_LINE DEDENT else : NEW_LINE INDENT right = x NEW_LINE DEDENT if ( value < 0.000001 and value >= 0 ) : NEW_LINE INDENT return x NEW_LINE DEDENT