def dumbguy_minimize(f, xmin, xmax, xstep):
prev = f(xmin)<EOL>this = f(xmin+xstep)<EOL>for x in frange(xmin+xstep,xmax,xstep):<EOL><INDENT>next = f(x+xstep)<EOL>if this < prev and this < next: return x, this<EOL>prev = this<EOL>this = next<EOL><DEDENT>return x, this<EOL>
This just steps x and looks for a peak

returns x, f(x)