def dichotomie(f,a,b,epsilon): while b-a>epsilon: m=(a+b)/2 if f(m)==0: a=m b=m else: if f(a)*f(m)<0: b=m else: a=m return a