PolynomialTools[Approximate]
Divide
compute approximate multivariate Divide
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Divide(F, G, vars)
Divide(F, G, vars, options)
F
-
: polynom({numeric,complex(numeric)})
G
vars
: a set or list of variables
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 degree⁡G,vars. Divide then returns both the quotient and the new value for g as a sequence q,gnew
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.
with⁡PolynomialTools:-Approximate:
infolevelPolynomialTools≔1
d≔sqrt⁡2.0⁢x2+y2−1
d≔1.414213562⁢x2+1.414213562⁢y2−1.414213562
G≔sort⁡x2−y3+1,x,y;F≔sort⁡expand⁡d⁢G,x,y
G≔−y3+x2+1
F≔−1.414213562⁢x2⁢y3−1.414213562⁢y5+1.414213562⁢x4+1.414213562⁢x2⁢y2+1.414213562⁢y3+1.414213562⁢y2−1.414213562
ad_8≔Divide⁡expand⁡F+10−8⁢x⁢y,expand⁡G+10−8⁢x2⁢y,x,y
Divide: computed approximate quotient has backward error 2.291288e-08 Divide: computed approximate quotient has backward error 2.291288e-08
ad_8≔−1.41421356376777+1.72890601399040×10−16⁢x+4.71404493218586×10−9⁢y+1.41421356730330⁢x2+3.33333340088403×10−9⁢x⁢y+1.41421356200000⁢y2
ad_8≔sort⁡tcoeff⁡d⁢fnormal⁡expand⁡ad_8tcoeff⁡ad_8,x,y
ad_8≔1.414213566⁢x2+1.414213560⁢y2−1.414213562
ilog10⁡norm⁡expand⁡d−ad_8,2norm⁡d,2
−9
ad_4≔Divide⁡expand⁡F+10−5⁢randpoly⁡x,y,degree=2,expand⁡G+10−5⁢randpoly⁡x,y,degree=2,x,y
Divide: computed approximate quotient has backward error 4.429297e-03 Divide: computed approximate quotient has backward error 4.429297e-03
ad_4≔−1.41434511367100+0.0000543862479197577⁢x−0.000574711926059124⁢y+1.41394268380192⁢x2+0.000290375854595681⁢x⁢y+1.41436980349329⁢y2
ad_4≔sort⁡tcoeff⁡d⁢fnormal⁡expand⁡ad_4tcoeff⁡ad_4,x,y
ad_4≔1.413811170⁢x2+0.0002903488460⁢x⁢y+1.414238250⁢y2+0.00005438118932⁢x−0.0005746584707⁢y−1.414213562
ilog10⁡norm⁡expand⁡d−ad_4,2norm⁡d,2
−4
ilog10⁡norm⁡expand⁡F−G⁢ad_4,2norm⁡F,2
ad_4t,g_4t≔Divide⁡expand⁡F+10−5⁢randpoly⁡x,y,degree=2,expand⁡G+10−5⁢randpoly⁡x,y,degree=2,x,y,total
Divide: computed approximate quotient has backward error 2.944201e+00 Divide: computed approximate quotient has backward error 7.641890e-04
ad_4t,g_4t≔2.50681809329971−0.0000321578835647818⁢x+0.000133334153707270⁢y−2.50748278515560⁢x2+0.000259709005629062⁢x⁢y−2.50751288549775⁢y2,−0.564186321542632+0.000153844663562707⁢x−0.000129322053759674⁢y−0.564015199549086⁢x2−0.0000199719037823165⁢x⁢y+6.73994336533553×10−6⁢y2+0.0000267357725492679⁢x3−0.0000380064168235786⁢x2⁢y+0.0000530108409072412⁢x⁢y2+0.564029568713338⁢y3
ilog10⁡norm⁡expand⁡F−ad_4t⁢g_4t,2norm⁡F,2
The PolynomialTools:-Approximate:-Divide command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
ConvolutionMatrix
divide
LinearAlgebra:-LeastSquares
SNAP
Download Help Document