#!/usr/bin/python3 # # La méthode de Newton def f(x): # la fonction f dont un cherche un zéro return x**5 - x - 1 def df(x): # la fonction dérivée de f return 5 * x**4 - 1 epsilon = 1.E-5 # la tolérance x = 1. # valeur pour commencer la recherche x_ancien = x + 2 * epsilon # le x de l'itération précédente while abs(x - x_ancien) > epsilon: x_ancien = x x = x - f(x) / df(x) print("Le zéro est à x =", x)