 Divide - Maple Help

PolynomialTools[Approximate]

 Divide
 compute approximate multivariate Divide Calling Sequence Divide(F, G, vars) Divide(F, G, vars, options) Parameters

 F - : polynom({numeric,complex(numeric)}) G - : polynom({numeric,complex(numeric)}) vars - : a set or list of variables Options

 • noexact
 if given then no exact division will be attempted before trying approximation methods
 • optimize
 if given then a post-processing step is done on the output, using Optimization:-NLPSolve to return an approximate quotient with smaller backward error. This option is generally more useful when the total option (below) is being used. Optionally, it can be given as optimize=list with a list of extra options to be passed to optimization.
 • total
 if given then the division is computed as a total least squares problem using a low rank approximation of a SylvesterMatrix with the degree parameter set to $\mathrm{degree}\left(G,\mathrm{vars}\right)$. Divide then returns both the quotient and the new value for g as a sequence $q,{g}_{\mathrm{new}}$ Description

 • After some basic preprocessing to handle exact cases, the numerical quotient of F and G is computed using LinearAlgebra:-LeastSquares on the ConvolutionMatrix of F. This treats F as approximate and G as exact.
 • The total option can be used to compute the division as a total least squares problem instead. That computation treats both F and G as approximate and returns sequence of the approximate quotient and the new G.
 • If the total degree of F is not strictly greater than the total degree of G, then an approximate division is not possible and and error will be given.
 • This command will work on univariate polynomials, but the Quotient and Remainder commands in the SNAP package may sometimes be a better choice. Examples

 > $\mathrm{with}\left(\mathrm{PolynomialTools}:-\mathrm{Approximate}\right):$
 > $\mathrm{infolevel}\left[\mathrm{PolynomialTools}\right]≔1$
 ${{\mathrm{infolevel}}}_{{\mathrm{PolynomialTools}}}{≔}{1}$ (1)
 > $d≔\mathrm{sqrt}\left(2.0\right)\left({x}^{2}+{y}^{2}-1\right)$
 ${d}{≔}{1.414213562}{}{{x}}^{{2}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (2)
 > $G≔\mathrm{sort}\left({x}^{2}-{y}^{3}+1,\left[x,y\right]\right);$$F≔\mathrm{sort}\left(\mathrm{expand}\left(dG\right),\left[x,y\right]\right)$
 ${G}{≔}{-}{{y}}^{{3}}{+}{{x}}^{{2}}{+}{1}$
 ${F}{≔}{-}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{3}}{-}{1.414213562}{}{{y}}^{{5}}{+}{1.414213562}{}{{x}}^{{4}}{+}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{2}}{+}{1.414213562}{}{{y}}^{{3}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (3)
 > $\mathrm{ad_8}≔\mathrm{Divide}\left(\mathrm{expand}\left(F+{10}^{-8}xy\right),\mathrm{expand}\left(G+{10}^{-8}{x}^{2}y\right),\left[x,y\right]\right)$
 Divide:   computed approximate quotient has backward error 2.291288e-08 Divide:   computed approximate quotient has backward error 2.291288e-08
 ${\mathrm{ad_8}}{≔}{-}{1.41421356376777}{-}{1.18686577420138}{×}{{10}}^{{-16}}{}{x}{+}{4.71404426419272}{×}{{10}}^{{-9}}{}{y}{+}{1.41421356730330}{}{{x}}^{{2}}{+}{3.33333326578262}{×}{{10}}^{{-9}}{}{x}{}{y}{+}{1.41421356200000}{}{{y}}^{{2}}$ (4)
 > $\mathrm{ad_8}≔\mathrm{sort}\left(\mathrm{tcoeff}\left(d\right)\mathrm{fnormal}\left(\frac{\mathrm{expand}\left(\mathrm{ad_8}\right)}{\mathrm{tcoeff}\left(\mathrm{ad_8}\right)}\right),\left[x,y\right]\right)$
 ${\mathrm{ad_8}}{≔}{1.414213565}{}{{x}}^{{2}}{+}{1.414213560}{}{{y}}^{{2}}{-}{1.414213562}$ (5)
 > $\mathrm{ilog10}\left(\frac{\mathrm{norm}\left(\mathrm{expand}\left(d-\mathrm{ad_8}\right),2\right)}{\mathrm{norm}\left(d,2\right)}\right)$
 ${-9}$ (6)
 > $\mathrm{ad_4}≔\mathrm{Divide}\left(\mathrm{expand}\left(F+{10}^{-5}\mathrm{randpoly}\left(\left\{x,y\right\},\mathrm{degree}=2\right)\right),\mathrm{expand}\left(G+{10}^{-5}\mathrm{randpoly}\left(\left\{x,y\right\},\mathrm{degree}=2\right)\right),\left[x,y\right]\right)$
 Divide:   computed approximate quotient has backward error 4.429297e-03 Divide:   computed approximate quotient has backward error 4.429297e-03
 ${\mathrm{ad_4}}{≔}{-}{1.41434511367100}{+}{0.0000543862479199072}{}{x}{-}{0.000574711926058415}{}{y}{+}{1.41394268380192}{}{{x}}^{{2}}{+}{0.000290375854595356}{}{x}{}{y}{+}{1.41436980349329}{}{{y}}^{{2}}$ (7)
 > $\mathrm{ad_4}≔\mathrm{sort}\left(\mathrm{tcoeff}\left(d\right)\mathrm{fnormal}\left(\frac{\mathrm{expand}\left(\mathrm{ad_4}\right)}{\mathrm{tcoeff}\left(\mathrm{ad_4}\right)}\right),\left[x,y\right]\right)$
 ${\mathrm{ad_4}}{≔}{1.413811170}{}{{x}}^{{2}}{+}{0.0002903488460}{}{x}{}{y}{+}{1.414238250}{}{{y}}^{{2}}{+}{0.00005438118932}{}{x}{-}{0.0005746584707}{}{y}{-}{1.414213562}$ (8)
 > $\mathrm{ilog10}\left(\frac{\mathrm{norm}\left(\mathrm{expand}\left(d-\mathrm{ad_4}\right),2\right)}{\mathrm{norm}\left(d,2\right)}\right)$
 ${-4}$ (9)
 > $\mathrm{ilog10}\left(\frac{\mathrm{norm}\left(\mathrm{expand}\left(F-G\mathrm{ad_4}\right),2\right)}{\mathrm{norm}\left(F,2\right)}\right)$
 ${-4}$ (10)
 > $\mathrm{ad_4t},\mathrm{g_4t}≔\mathrm{Divide}\left(\mathrm{expand}\left(F+{10}^{-5}\mathrm{randpoly}\left(\left\{x,y\right\},\mathrm{degree}=2\right)\right),\mathrm{expand}\left(G+{10}^{-5}\mathrm{randpoly}\left(\left\{x,y\right\},\mathrm{degree}=2\right)\right),\left[x,y\right],\mathrm{total}\right)$
 Divide:   computed approximate quotient has backward error 2.944201e+00 Divide:   computed approximate quotient has backward error 7.641890e-04
 ${\mathrm{ad_4t}}{,}{\mathrm{g_4t}}{≔}{2.50681809329971}{-}{0.0000321578835633482}{}{x}{+}{0.000133334153707425}{}{y}{-}{2.50748278515560}{}{{x}}^{{2}}{+}{0.000259709005629063}{}{x}{}{y}{-}{2.50751288549775}{}{{y}}^{{2}}{,}{-}{0.564186321542632}{+}{0.000153844663563058}{}{x}{-}{0.000129322053759773}{}{y}{-}{0.564015199549086}{}{{x}}^{{2}}{-}{0.0000199719037822285}{}{x}{}{y}{+}{6.73994336546599}{×}{{10}}^{{-6}}{}{{y}}^{{2}}{+}{0.0000267357725493619}{}{{x}}^{{3}}{-}{0.0000380064168235496}{}{{x}}^{{2}}{}{y}{+}{0.0000530108409072188}{}{{y}}^{{2}}{}{x}{+}{0.564029568713337}{}{{y}}^{{3}}$ (11)
 > $\mathrm{ilog10}\left(\frac{\mathrm{norm}\left(\mathrm{expand}\left(F-\mathrm{ad_4t}\mathrm{g_4t}\right),2\right)}{\mathrm{norm}\left(F,2\right)}\right)$
 ${-4}$ (12) Compatibility

 • The PolynomialTools:-Approximate:-Divide command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.