如何实现多元多项式的霍纳方案?
背景
我需要在 Fortran90/95 中使用 Horner 方案 求解多个变量中的多项式。这样做的主要原因是使用霍纳方案评估多项式时可以提高效率和准确性。
我目前有一个针对单变量/单变量多项式的霍纳方案的实现。然而,事实证明,开发一个使用霍纳方案评估多元多项式的函数超出了我的能力范围。
一个示例二元多项式为:12x^2y^2+8x^2y+6xy^2+4xy+2x+2y,它将因式分解为 x(x(y(12y+8))+y(6y+4 )+2)+2y 然后评估 x 和 的特定值y。
研究
我做了研究并发现了一些论文,例如:
Staff.ustc.edu.cn/~xinmao/ISSAC05/pages/bulletins/articles/147/horner Corrected.pdf
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.40.8637&rep=rep1&type=pdf
www.is.titech.ac.jp/~kojima/articles/B-433.pdf
问题
然而,我不是数学家或计算机科学家,所以我在用于传达算法和想法的数学方面遇到了麻烦。
据我所知,基本策略是将多元多项式转换为单独的单变量多项式并以这种方式进行计算。
谁能帮助我吗?如果有人可以帮助我将算法转换为伪代码,以便我可以自己在 Fortran 中实现,我将非常感激。
Background
I need to solve polynomials in multiple variables using Horner's scheme in Fortran90/95. The main reason for doing this is the increased efficiency and accuracy that occurs when using Horner's scheme to evaluate polynomials.
I currently have an implementation of Horner's scheme for univariate/single variable polynomials. However, developing a function to evaluate multivariate polynomials using Horner's scheme is proving to be beyond me.
An example bivariate polynomial would be: 12x^2y^2+8x^2y+6xy^2+4xy+2x+2y which would factorised to x(x(y(12y+8))+y(6y+4)+2)+2y and then evaluated for particular values of x & y.
Research
I've done my research and found a number of papers such as:
staff.ustc.edu.cn/~xinmao/ISSAC05/pages/bulletins/articles/147/hornercorrected.pdf
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.40.8637&rep=rep1&type=pdf
www.is.titech.ac.jp/~kojima/articles/B-433.pdf
Problem
However, I'm not a mathematician or computer scientist, so I'm having trouble with the mathematics used to convey the algorithms and ideas.
As far as I can tell the basic strategy is to turn a multivariate polynomial into separate univariate polynomials and compute it that way.
Can anyone help me? If anyone could help me turn the algorithms into pseudo-code that I can implement into Fortran myself, I would be very grateful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于两个变量,可以将多项式系数存储在rank=2 矩阵
K(n+1,n+1)
中,其中n 是多项式的阶数。然后观察以下模式(以伪代码形式)。每一行都是以
y
形式表示的单独的本垒打方案,并且全部都是以x
形式表示的最终本垒打方案。要使用
FORTRAN
或任何语言进行编码,请创建一个中间向量z(n+1)
,其中homers(value,vector) 是使用存储在
向量
中的多项式系数实现单变量评估。For two variables one can store the polynomial coefficients in a rank=2 matrix
K(n+1,n+1)
where n is the order of the polynomial. Then observe the following pattern (in pseudo-code)Each row is a separate homer's scheme in terms of
y
and all-together is a final homer's scheme in terms ofx
.To code in
FORTRAN
or any language create an intermediate vectorz(n+1)
such thatand
where
homers(value,vector)
is an implementation of the single variable evaluation with polynomial coefficients stored invector
.