Annales UMCS Informatca AI VIII, 2 2008) 5 14 DOI: 10.2478/v10065-008-0020-6 An effcent algorthm for multvarate Maclaurn Newton transformaton Joanna Kapusta Insttute of Mathematcs and Computer Scence, John Paul II Catholc Unversty of Lubln, Konstantynów 1H, 20-708 Lubln, Poland Abstract Ths paper presents explct formulae for multvarate Maclaurn-Lagrange M : K n 1 n 2... n d K n 1 n 2... n d and Maclaurn-Newton P : K n 1 n 2... n d K n 1 n 2... n d transformatons wth respect to ponts whose coordnates form geometrc sequences. Moreover, effcent algorthms for these transformatons are gven. Both of them d perform computatons wth a runnng tme of O j=1 n j log ) d j=1 n j + O d ) d j=1 n j. 1. Introducton Let n = n 1, n 2,..., n d ) be a d-tuple of postve ntegers and let Q n be the lattce of all d-tuples α = α 1, α 2,..., α d ) wth the nteger coordnates satsfyng the nequalty 0 α < n for = 1, 2,..., d. Usng the mult-ndex notaton, we defne the space P d n = P d n K) of all polynomals n the varable x = x 1, x 2,..., x d ) wth coeffcents a α = a α1,α 2,...,α d n a feld K of the form p x) = α Q n a α x α, E-mal address: jkapusta@kul.lubln.pl Unauthentcated
6 Joanna Kapusta where the summaton extends over all n 1 n 2 n d d-tuples from the lattce Q n and a α = 1 p α) 0) α! x α, x α = x α 1 1 xα 2 2 xα d d, α! = α!. Addtonally, suppose that some parwse dstnct ponts =1 x,0, x,1,..., x,n 1, x,j x,k whenever j k, are prescrbed n K for each = 1, 2,..., d. Then one can defne the Lagrange base n 1 x x,j L α x) =, α = α 1, α 2,..., α d ) Q n, x,α x,j =1 j α and the Newton base B α x) = α 1 =1 x x,j ), α = α 1, α 2,..., α d ) Q n, n the space P d n, n = n 1, n 2,..., n d ). Here and further n ths paper, t s assumed that products are equal to 1 whenever ther upper ndces are smaller than the lower ones. The usual tensor product approach shows drectly that p x) = α Q n y α L α x), where y α = p x α ) and p x) = c α B α x), α Q n where c α denote the multvarate dvded dfferences defned by c α = y β α β clq α x,β x,j) =1 j β wth and clq α = {β = β 1, β 2,.., β d ) : 0 β α for = 1, 2,..., d} y β = p x β ) = a α α Q n =1 1) x α,β. 2) Formulae 1) and 2) show drectly that the Maclaurn-Newton transformaton P : a α ) α Qn c α ) α Qn, Unauthentcated
An effcent algorthm for... 7 s a composton of the Maclaurn-Lagrange transformaton M : a α ) α Qn y α ) α Qn and the Lagrange-Newton transformaton N : y α ) α Qn c α ) α Qn. In ths paper we present fast algorthms for the above transformatons. Inverse algorthms wll be presented elsewhere. In order to decrease the complexty of computatons n our algorthm, we use the multdmensonal convoluton of a hypermatrx a = a α ) α Qn and a vector b = b ) d =1, b = b,0, b,1,..., b,n 1) u = a b wth coordnates equal to u α = a β b α β, α = α 1, α 2,..., α d ) Q n. β clq α Defnton 1. A hypermatrx w = w α ) α Qn = a b K n 1 n 2 n d, 1 d, s sad to be the -th partal hypermatrx convoluton of a hypermatrx a = a α ) α Qn and a vector b = b,0, b,1,..., b,n 1), whenever each column w β1,...,β 1,,β +1,...,β d = a β1,...,β 1,,β +1,...,β d b, 0 β j < n j 1, j = 1, 2,..., 1, + 1,..., d, of the hypermatrx w s equal to the one-dmensonal lnear convoluton of column a β1,...,β 1,,β +1,...,β d = a β1,...,β 1,j,β +1,...,β d ) n 1. and vector b. The notaton of the partal hypermatrx convolutons enables rewrtng the multdmensonal convoluton u = u α ) α Qn n the followng hypermatrx form u =... a 1 b 1 ) 2 b 2 ) 3 d b d ) wth b = b,0, b,1,..., b,n 1) and a = a α ) α Qn. It s clear that the smplest algorthm for computng -partal hypermatrx convoluton needs to compute N/n one-dmensonal convolutons for vectors of sze n, where N = n 1 n 2...n d. Hence, t s easy to show, that the algorthm for computng multdmensonal convoluton s of the order N/n 1 On 1 log n 1 ) +... + N/n d On d log n d ) = ON log N). Unauthentcated
8 Joanna Kapusta In the smlar way we defne the multdmensonal generalzed convoluton of a hypermatrx a = a α ) α Qn and a vector b = b ) d =1, b = b,0, b,1,..., b,n 1) wth the coordnates equal to v α = v = a b β Q n a β b α β, α = α 1, α 2,..., α d ) Q n. The only dfference s that n ths case, n the defnton of generalzed -th partal hypermatx convoluton 1 d), each column of the result hypermatrx s taken from the one-dmensonal generalzed convoluton of the correspondng column and vector. The order of the algorthm for computng the multdmensonal generalzed convoluton s the same as the order of the algorthm for computng the multdmensonal convoluton and s equal to O N log N). Algorthms for computng one-dmensonal convolutons can be found n [2], [3]. The cost of our algorthm for the Maclaurn-Lagrange transformaton dffers from that of computng the multdmensonal generalzed convoluton by a component of order O d ) d j=1 n j, whenever the coordnates of ponts x α = x 1,α1, x 2,α2,..., x d,αd ), α Q n, are generated by the followng formulae x,j = λ γ j, = 1, 2,..., d, j = 0, 1,..., n 1, where γ 0, γ 1 and λ 0 = 1, 2,..., d) are fxed n K. Moreover, the algorthm for computng the multvarate Maclaurn Newton transformaton n ths case has the same runnng tme. It s known that n the unvarate case there exsts fast evaluaton O n log n) algorthm for the polynomal of degree less than n at n ponts, whch form a geometrc sequence [1]. Moreover, there exsts fast evaluatng and dfferentatng algorthm for the Hermte nterpolatng polynomal wth n ponts of the form x = αx 1 + β, = 1, 2,..., n 1, α 0, x 0 = γ 3) of multplcty 2 [5]. Bostan and Schost n [4] gve an overall revew of unvarate polynomal transformaton, whenever ponts form an arthmetc or geometrc sequence. In [6] t was shown how to extend the Lagrange-Newton transformaton and ts nverse n the unvarate case to the ponts generated by the recurrent formulae of the form 3). Unauthentcated
An effcent algorthm for... 9 2. Multvarate Maclaurn-Lagrange transformaton In ths secton we descrbe how to evaluate the multvarate polynomal px) = a β x β, x β = x β1 1 xβ 2 2 xβ d d 4) β Q n at ponts x α, α = α 1, α 2,..., α d ) Q n, whch coordnates form geometrc sequences. Note that t s equvalent to computng the multvarate Maclaurn-Lagrange transformaton M : a α ) α Qn y α ) α Qn, where y α = p x α ). If we know the coeffcents a α of the Maclaurn polynomal expanson 4), then the values y α = px α ), α Q n, at the ponts of the form x α = x 1,α1, x 2,α2,..., x d,αd ), α Q n x,j = λ γ j, = 1, 2,.., d, j = 0, 1,..., n 1, 5) where λ 0, γ 0, γ 1 are fxed n K, are equal to y α = β Q n a β x β α = = a β β Q n =1 a β λ β γβ α β Q n =1 λ β β 1 γ j α γ j α β γ j Hence, we obtan n d n 2 n 1 y α =... u β w 1,α1 β 1 w 2,α2 β 2... w d,αd β d q α, 6) β d =0 whenever we set and β 2 =0 u β = a β w,k = 1 k =1 γ j β 1 =0 λ β β 1 γ j, q β =. β γ j, β Q n 7) =1, = 1, 2,..., d, k = 0, 1,..., n 1. 8) Unauthentcated
10 Joanna Kapusta By usng partal hypermatrx generalzed convolutons, = 1, 2,..., d formula 6) can be wrtten equvalently y =... u 1 w 1 ) 2 w 2 ) 3 d w d ) q, where denotes componentwse multplcaton. Ths completes the proof of the followng theorem. Theorem 1. If M : a α ) α Qn y α ) α Qn denotes the multvarate Maclaurn Lagrange transformaton wth respect to the ponts x α = x 1,α1, x 2,α2,..., x d,αd ) whose coordnates are generated by the formulae x,j = λ γ j, = 1, 2,.., d, j = 0, 1, 2,..., n 1, where λ 0, γ 1, γ 0, then we get y =... u 1 w 1 ) 2 w 2 ) 3 d w d ) q, 9) where elements of u = u α ) α Qn, q = q α ) α Qn and w = w,0, w,1,..., w,n 1) are defned as n formulae 7) and 8). Corollary 1. The algorthm for evaluatng the multvarate Maclaurn Lagrange transformaton M based on formula 9) has a runnng tme of ON log N)) + OdN), where N = n 1 n 2 n d. Remark 1. If we assume n 2 for = 1, 2,..., d, then log 2 N d and the order of the algorthm for evaluatng the multvarate Maclaurn Lagrange transformaton M can be reduced nto the form ON log N)) + O dn) = ON log N). 3. Multvarate Maclaurn-Newton transformaton In ths secton we present fast algorthm for the multvarate Maclaurn Newton transformaton P : a α ) α Qn c α ) α Qn, of the coef- where a denotes the hypermatrx of dmenson n 1 n 2 n d fcents a α of the Maclaurn polynomal expanson p x) = a α x α, α Q n and c denotes the hypermatrx of multvarate dvded dfferences c α gven by formula 1). Unauthentcated
An effcent algorthm for... 11 If coordnates of the ponts x α form geometrc sequences 5), then one can show that the multvarate Maclaurn-Newton transformaton can be computed by usng only O n j log + O d j=1 j=1 n j base operatons from the feld K. Usng the fact that the coordnates of ponts x α = x 1,α1, x 2,α2,..., x d,αd ) satsfy the relaton of form 5) we obtan α,j β x,β x,j ) = = λ α α 1 γ j α,j β 1) β β 1 λ γ β λ γ j α β 1 j=1 ) n j ) α β 1 γ j Consequently, one can nsert formula 10) nto formula 1) n order to get c α = y β β clq α =1 1) β β 1 α β 1 ) α β 1 γ j ) ) λ α α 1 γ j Therefore, we have α d α 2 α 1 c α =... g β h 1,α1 β 1 g 2,α2 β 2... h d,αd β d /t α, β d =0 β 2 =0 β 1 =0 10). whenever we set g β = 1) β =1 y β β 1 ), t β = =1 λ β α 1 γ j, β Q n 11) and h,k = k 1 k 1 γ j ), = 1, 2,..., d, k = 0, 1,..., n 1. 12) Unauthentcated
12 Joanna Kapusta Elements of the hypermatrx y = y β ) β Qn of polynomal values can be computed by the algorthm for the Maclaurn-Lagrange transformaton. The notaton of partal hypermatrx convolutons enables rewrtng the hypermatrx c = c α ) α Qn of multvarate dvded dfferences n the followng form c =... g 1 h 1 ) 2 h 2 ) 3 d h d ) /t wth h = h,0, h,1,..., h,n 1) and hypermatrces g = g α ) α Qn and t = t α ) α Qn defned as n formulae 11) and 12). In ths formula the dvson of hypermatrces s supposed to be componentwse. Ths yelds the followng theorem. Theorem 2. If P : a α ) α Qn c α ) α Qn denotes the multvarate Maclaurn Newton transformaton wth respect to the ponts x α = x 1,α1, x 2,α2,..., x d,αd ) whose coordnates are generated by the formulae x,j = λ γ j, = 1, 2,.., d, j = 0, 1, 2,..., n 1, where λ 0, γ 1, γ 0, then we obtan c =... g 1 h 1 ) 2 h 2 ) 3 d h d ) /t, 13) where elements of g = g α ) α Qn, t = t α ) α Qn and h = h,0, h,1,..., h,n 1) are defned as n formulae 11) and 12). Corollary 2. The algorthm for evaluatng the multvarate Maclaurn Newton transformaton P based on 13) has a runnng tme of ON log N)) + OdN), where N = n 1 n 2 n d. Remark 2. If we assume n 2 for = 1, 2,..., d, then log 2 N d and the order of the algorthm for evaluatng the multvarate Maclaurn Newton transformaton P can be reduced nto the form ON log N)) + O dn) = ON log N). For the completeness of consderaton, we present the algorthm for computng multvarate Maclaurn-Newton transformaton n greater detal. Note that steps 1-4 of the algorthm below consst of computng the Maclaurn Lagrange transformaton and the remanng part s the algorthm for computng the Lagrange-Newton transformaton. Algorthm 1. The multvarate Maclaurn Newton transformaton wth respect to the ponts x α = x 1,α1, x 2,α2,..., x d,αd ), where α = α 1, α 2,..., α d ) Q n, n = n 1, n 2,..., n d ) and x,j = λ γ j = 1, 2,..., d, j = 0, 1, 2,..., n 1). Input: A hypermatrx a = a α ) α Qn of the coeffcents of Maclaurn polynomal Unauthentcated
An effcent algorthm for... 13 expanson, scalar vectors λ = λ 1, λ 2,..., λ d ), γ = γ 1, γ 2,..., γ d ) n K d, and the vector n = n 1, n 2,..., n d ) of postve ntegers. Output: A hypermatrx c = c α ) α Qn of multvarate dvded dfferences. 1. Use 7) to evaluate u α, q α for each α Q n. 2. Use 8) to evaluate w,j, for = 1, 2,..., d and j = 0, 1,..., n 1. 3. For from 1 to d do the followng: 3.1 Use the FFT-algorthm to compute generalzed partal hypermatrx convolutons u = u w of vectors w = w,0, w,1,..., w,n 1) wth correspondng columns of the hypermatx u. 4. Perform componentwse multplcaton y = u q. 5. Use 11) to evaluate g α, t α for each α Q n. 6. Use 12) to evaluate h,j, for = 1, 2,..., d and j = 0, 1,..., n 1. 7. For from 1 to d do the followng: 7.1 Use the FFT-algorthm to compute partal hypermatrx convolutons g = g h of the vectors h = h,0, h,1,..., h,n 1) wth correspondng columns of the hypermatrx g. 8. Perform componentwse dvson c = g/t. 9. Return c). 4. Conclusons In ths paper, we present the multvarate Maclaurn Lagrange and Maclaurn Newton transformatons. Both of them were dscussed wth respect to specal confguratons of ponts. Coordnates of these ponts x α = x 1,α1, x 2,α2,..., x d,αd ), α Q n, are generated by the followng formulae x,j = λ γ j, = 1, 2,..., d, j = 0, 1,..., n 1, where γ 0, γ 1 and λ 0 = 1, 2,..., d) are fxed n K. Moreover, we have presented fast algorthms for these transformatons. These algorthms belong to the class of algorthms whch sgnfcantly use convolutons. The computatonal complexty of these algorthms takes only Od d j=1 n j) o- peratons more than the multdmensonal convoluton computng. References [1] Aho A., Stegltz K., Ullman J., Evaluatng polynomals at fxed sets of ponts, SIAM Journal Comput. 4 1975) 533. [2] Aho A., Hopcroft J., Ullman J., The Desgn and Analyss of Computer Algorthms, Addson-Wesley, London 1974. Unauthentcated
14 Joanna Kapusta [3] Bn D., Pan Y. V., Polynomal and matrx computaton, Brkhäuser, Boston 1984. [4] Bostan A., Schost E., Polynomal evaluaton and nterpolaton on specal sets of ponts, Journal of Complexty 21 2005) 420. [5] Kapusta J., Smarzewsk R., Fast algorthms for polynomal evaluaton and dfferentaton at specal knots, Annales UMCS Informatca AI 6 2007) 95. [6] Smarzewsk R., Kapusta J., Fast Lagrange Newton transformatons, Journal of Complexty 23 2007) 336. Unauthentcated