-- bisection method for solving non-linear equations delta=1e-6 -- tolerance function bisect(f,a,b,fa,fb) local c=(a+b)/2 print(n .. " c=" .. c .. " a=" .. a .. " b=" .. b .. "\n") if c==a or c==b or math.abs(a-b)