def invert_increasing_function(f, f0, xmin, xmax, tolerance, max_iterations=<NUM_LIT:100>):
for n in range(max_iterations):<EOL><INDENT>x = <NUM_LIT:0.5>*(xmin+xmax)<EOL>df = f(x)-f0<EOL>if _n.fabs(df) < tolerance: return x<EOL>if df > <NUM_LIT:0>: xmin=x<EOL>else:      xmax=x<EOL><DEDENT>print("<STR_LIT>")<EOL>return <NUM_LIT:0.5>*(xmin+xmax)<EOL>
This will try try to qickly find a point on the f(x) curve between xmin and xmax that is
equal to f0 within tolerance.