Combien faut-il de multiplications et d'addition pour calculer l'image d'un nombre par un polynôme ?
Pour calculer la puissance n d'un nombre nous utiliserons la méthode basique :$$x^n=\underbrace{x×x×x×\ldots×x}_{n fois}$$
Soit :
$$\fonction{f}{\mathbb{R}}{\mathbb{R}}{x}{2x+5}$$Soit :
$$\fonction{g}{\mathbb{R}}{\mathbb{R}}{x}{4x^2+2x+5}$$Soit :
$$\fonction{h}{\mathbb{R}}{\mathbb{R}}{x}{2x^3+4x^2+2x+5}$$Le mathématicien anglais William George Horner (1786-1837) a proposé une autre manière de calculer l'image d'un nombre par une fonction polynôme.
Pour calculer l'image d'un nombre x par la fonction polynôme f(x)=\(a_nx^n+a_{n-1}x^{n-1}+...a_1x+a_0\) on utilise l'algorithme suivant :
degré du polynôme | Nombre d'opérations méthode 1 | Nombre d'opérations méthode 2 | Rapport :\(\frac{Nombre\: d'opérations\: méthode\: 1}{Nombre\: d'opérations\: méthode\: 2}\) |
---|---|---|---|
1 | |||
8 | |||
32 | |||