This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.

 Algebra`Horner` This package applies Horner's rule to rearrange polynomials in Horner form. This is useful for efficient and stable numerical evaluation. Any polynomial can be rewritten in Horner, or nested, form. Assume that can be calculated using only multiplications for integer  . For a polynomial of degree , the Horner form requires multiplications and additions. The expanded form, however, requires multiplications, which is already more than twice as expensive for a polynomial of degree 10. Thus, one advantage of Horner form is that the work involved in exponentiation is distributed across addition and multiplication, resulting in savings of some basic arithmetic operations. Another advantage is that Horner form is more stable to evaluate numerically when compared with the expanded form. The reason for this is that each sum and product involve quantities which vary on a more evenly distributed scale. Factoring polynomials in Horner or nested form. The function Horner can be used for both univariate and multivariate polynomials. It also works efficiently on both sparse and dense polynomials and fractional exponents. This loads the package. In[1]:= < All, PlotPoints -> 2000]//Timing Out[10]= Here the polynomial is put in Horner form before plotting. The time required to rearrange the polynomial is usually small compared to the time required to render the plot, and the time required to evaluate the polynomial is significantly reduced. The plot reveals that the Horner form of the polynomial is much more stable to evaluate using machine-precision numbers. In[11]:= Plot[Evaluate[Horner[dpoly[x]]], {x, 1, 1.01}, PlotRange -> All, PlotPoints -> 2000]//Timing Out[11]= High-precision arithmetic can be used to overcome the problem of cancellation. However, high-precision arithmetic is expensive when compared with machine-precision arithmetic. It is preferable to seek alternative strategies, such as structural transformations, whenever possible. For example, the Horner form can be used to reduce the amount of extra precision required to obtain reliable solutions. Factoring rational functions in Horner or nested form. Several types of expressions are detected by Horner, and appropriately nested forms are produced. The following example illustrates how to improve the efficiency of evaluating a rational polynomial approximant to a function. This loads the package Calculus`Pade`. In[12]:= <