Polynomial Expressions and Horner's Method
Some expressions, such as polynomials, use the same variable several times for their
solution. For example, the expression
4
3
2
Ax
+ Bx
+ Cx
+ Dx + E
uses the variable x four different times. A program to calculate such an expression
using RPN operations could repeatedly recall a stored copy of x from a variable.
Example:
4
3
Write a program using RPN operations for 5x
+ 2x
, then evaluate it for x = 7.
13-26
Simple Programming