How to implement the Horner scheme for multidimensional polynomials?

Background

I need to solve polynomials from several variables using the Horner scheme in Fortran90 / 95. The main reason for this is the increased efficiency and accuracy arising from the use of the Horner scheme for estimating polynomials.

I currently have an implementation of the Horner scheme for one-dimensional / single variable polynomials. However, the development of a function for estimating multidimensional polynomials using the Horner scheme is beyond me.

Example of a two-dimensional polynomial: 12x ^ 2y ^ 2 + 8x ^ 2y + 6xy ^ 2 + 4xy + 2x + 2y, which will be decomposed into x (x (y (12y + 8)) + y (6y + 4) +2) + 2y and then evaluated for specific values ​​of x and y.

Study

I conducted my research and found a number of works, 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 am not a mathematician or computer scientist, so I have problems with the mathematics used to convey algorithms and ideas.

As far as I can tell, the main strategy is to turn a multidimensional polynomial into separate one-dimensional polynomials and calculate it in this way.

Can anyone help me? If anyone could help me turn the algorithms into pseudo-code that I can implement in Fortran, I would be very grateful.

+3
1

= 2 K(n+1,n+1), n - . ( )

p(x,y) =     (K(1,1)+y*(K(1,2)+y*(K(1,3)+...y*K(1,n+1))) +
           x*(K(2,1)+y*(K(2,2)+y*(K(2,3)+...y*K(2,n+1))) +
         x^2*(K(3,1)+y*(K(3,2)+y*(K(3,3)+...y*K(3,n+1))) +
         ...
         x^n*(K(n+1,1)+y*(K(n+1,2)+y*(K(n+1,3)+...y*K(n+1,n+1)))

y - x.

FORTRAN z(n+1) ,

z(i) = homers(y,K(i,1:n+1))

p = homers(x,z(1:n+1))

homers(value,vector) , vector.

+5

Source: https://habr.com/ru/post/1750396/


All Articles