def find_zero_bisect(f, xmin, xmax, xprecision):
if f(xmax)*f(xmin) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>",xmin,"<STR_LIT:to>",xmax)<EOL>return None<EOL><DEDENT>temp = min(xmin,xmax)<EOL>xmax = max(xmin,xmax)<EOL>xmin = temp<EOL>xmid = (xmin+xmax)*<NUM_LIT:0.5><EOL>while xmax-xmin > xprecision:<EOL><INDENT>y = f(xmid)<EOL>if y > <NUM_LIT:0>:<EOL><INDENT>if f(xmin) < <NUM_LIT:0>: xmax=xmid<EOL>else:           xmin=xmid<EOL><DEDENT>elif y < <NUM_LIT:0>:<EOL><INDENT>if f(xmin) > <NUM_LIT:0>: xmax=xmid<EOL>else:           xmin=xmid<EOL><DEDENT>else: return xmid<EOL>xmid = (xmin+xmax)*<NUM_LIT:0.5><EOL><DEDENT>return xmid<EOL>
This will bisect the range and zero in on zero.