# Rewriting polynomials for computers

• octohydra
In summary, the conversation discusses rewriting a polynomial using multiplication and addition operators instead of exponents, known as Horner's Rule. It is mentioned that there is an algorithm for this process and it can be implemented in various software such as Sage, MATLAB, and Mathematica. The conversation also suggests checking online for more information about Horner's Rule.
octohydra
Suppose I have a REALLY big polynomial:
$$a_0 + a_1 x + a_2 x^2 + a_3 x^3+a_4 x^4+ \cdots + a_n x^n$$
I can rewrite the polynomial as a combination of multiplication and addition operators (instead of exponents) that a computer tends to like as such:
$$a_0 + x \left( a_1 + x \left( a_2 + x \left( a_3 + x \left(a_4 + \cdots + a_n x \left)\right. \cdots \right)\right)\right)\right)$$

• Does this process have a name?
• Is there an algorithm to do this?
• Is there an implementation of this on Sage or MATLAB/Octave or Mathematica?

I believe this is called Horner's Rule. I'm sure there's an algorithm, but I don't recall what it is. Check online for more information about it.

I don't know what MATLAB and the others have for Horner's Rule.

Mark44 said:
I believe this is called Horner's Rule. I'm sure there's an algorithm, but I don't recall what it is. Check online for more information about it.

I don't know what MATLAB and the others have for Horner's Rule.

http://en.wikipedia.org/wiki/Horner_scheme"

Thanks! The information at the wiki page is more than plenty for me.

Last edited by a moderator:

## 1. What is the purpose of rewriting polynomials for computers?

The purpose of rewriting polynomials for computers is to simplify and optimize the representation of polynomials so that they can be easily manipulated and computed by computer algorithms. This involves converting the polynomial into a standard form, such as a monomial or a polynomial with descending powers, to reduce the number of operations needed for computation.

## 2. What are the main challenges in rewriting polynomials for computers?

The main challenges in rewriting polynomials for computers include identifying the correct standard form for the polynomial, handling different notations and formats, and dealing with potential errors or inaccuracies in the polynomial. There may also be challenges in efficiently handling large or complex polynomials and ensuring numerical stability in the computation process.

## 3. How do computers handle variables and coefficients in polynomials?

Computers typically represent variables and coefficients in polynomials using binary numbers, either as integers or floating-point numbers. The variables are assigned a numerical value, while the coefficients are stored in memory and used in mathematical operations to compute the polynomial.

## 4. Can rewriting polynomials for computers affect the accuracy of the results?

Yes, rewriting polynomials for computers can potentially affect the accuracy of the results. This is because the process of converting the polynomial into a standard form may involve rounding or approximations, which can introduce errors into the computation. However, these errors can be minimized by using appropriate algorithms and techniques.

## 5. Are there any specific programming languages or tools for rewriting polynomials?

There are no specific programming languages or tools designed solely for rewriting polynomials. However, there are mathematical libraries and software packages that provide functions and methods for polynomial manipulation and computation, such as MATLAB, Mathematica, and NumPy. Additionally, many programming languages have built-in data types and operations for handling polynomials, such as Python's polynomial class and R's poly() function.

• General Math
Replies
1
Views
821
• General Math
Replies
3
Views
2K
• General Math
Replies
4
Views
933
• General Math
Replies
6
Views
960
• General Math
Replies
6
Views
1K
• Precalculus Mathematics Homework Help
Replies
3
Views
1K
• General Math
Replies
2
Views
1K
• General Math
Replies
3
Views
839
• Calculus and Beyond Homework Help
Replies
8
Views
1K
• General Math
Replies
7
Views
862