<span>A function is a pre-written formula that is built into excel.
There are many functions which are pre-written into excel.
Some examples are the SUM function which adds the values in a given range. The AVERAGE function takes the average of values in a given range, etc.
</span>
Time in transit would be correct
def dx(fn, x, delta=0.001):
return (fn(x+delta) - fn(x))/delta
def solve(fn, value, x=0.5, maxtries=1000, maxerr=0.00001):
for tries in xrange(maxtries):
err = fn(x) - value
if abs(err) < maxerr:
return x
slope = dx(fn, x)
x -= err/slope
raise ValueError('no solution found')