Horner's rule
来源:互联网 发布:网络摄像机连接线 编辑:程序博客网 时间:2024/05/22 06:04
Horner's Rule for Polynomials
A general polynomial of degree can be written asIf we use the Newton-Raphson method for finding roots of the polynomial we need to evaluate both and its derivative for any .
It is often important to write efficient algorithms to complete a project in a timely manner. So let us try to design the algorithm for evaluating a polynomial so it takes the fewest flops (floating point operations, counting both additions and multiplications). For concreteness, consider the polynomial
The most direct evaluation computes each monomial one by one. It takes multiplications for each monomial and additions, resulting in flops for a polynomial of degree . That is, the example polynomial takes three flops for the first term, two for the second, one for the third, and three to add them together, for a total of nine. If we reuse from monomial to monomial we can reduce the effort. In the above example, working backwards, we can save from the second term and get for the first in one multiplication by . This strategy reduces the work to flops overall or eight flops for the example polynomial. For short polynomials, the difference is trivial, but for high degree polynomials it is huge. A still more economical approach regroups and nests the terms as follows:
(Check the identity by multiplying it out.) This procedure can be generalized to an arbitrary polynomial. Computation starts with the innermost parentheses using the coefficients of the highest degree monomials and works outward, each time multiplying the previous result by and adding the coefficient of the monomial of the next lower degree. Now it takes flops or six for the above example. This is the efficient Horner's algorithm.
- Horner's rule
- 霍纳法则(Horner's rule)
- 霍纳法则(Horner's rule)
- Horner rule
- 快速计算多项式:霍纳法则(Horner's rule)
- Horner Rule(霍纳法则)
- Horner Rule(霍纳法则)
- 多项式求解(霍纳规则(Horner Rule))
- 多项式求解(霍纳规则(Horner Rule))
- 上机一 D 水水的Horner Rule
- 霍內演算法(Horner’s Algorithm)
- 2016级算法第一次上机——D 水水的Horner Rule
- [3_2_ratios] Cramer's rule
- GOLDEN RULE(s) of design pattern
- 克莱姆法则(Cramer‘s Rule)
- 算法学习之Honer's Rule
- rule
- rule
- 在Windows XP 下安装OpenBravo 2.35 成功过程
- SQL中DATATIME类型的查询
- 理解.NET2.0中的事务
- 去除HTML标记
- 主空间
- Horner's rule
- ACE 实现 完成端口(win32_I/O模型)
- BJ HP GDCC 实习初记
- 半小时精通正则表达式!
- 大屏幕液晶电视的保养
- 数据公钥加密和认证中的私钥公钥
- select 模型
- Windows 中的 CALLBACK 函数
- 正则表达式语法