Performance - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Performance

 

frontend

iratrecon - rational reconstruction

sprem - sparse pseudo division

gcdex - extended Euclidean algorithm

Expand, Quo, and, Rem mod p

normal

indets, coeffs, degree, and miscellaneous

solve command and Groebner Bases

frontend

The frontend command is used extensively by Maple to map expressions to the domain of rational functions.  It was rewritten for Maple 2017 to reduce time and memory usage.  The typical gain is a factor of two but for complicated expressions it runs an order of magnitude faster.  The example below runs over 30 times faster in Maple 2017.

exprrandpolysinx,cosx,I:for i to 3 do expr  addrandpolyexpri,i=3..3; end:timefrontendlength,expr

0.265

(1.1)

iratrecon - rational reconstruction

The iratrecon command for rational reconstruction has been re-engineered in the kernel to improve performance.  The first two examples below run about 9x and 5x faster, respectively.  We have also added a new fraction-free syntax that returns true or false and assigns the numerator and denominator to the fifth and sixth arguments.  By not constructing fractions, the new syntax gains an additional factor of five speedup.

mprevprime260nextprime260:f  mulrandpolyi,'dense',i=x,y,z,t,u,v,w:f  Expandfrandmodm:timeiratreconf,m;timeiratreconf,m,scaled

5.116

0.530

(2.1)

bisqrtiquom,2:timeiratreconf,m,b,b,'n','d' # new syntax

0.124

(2.2)

sprem - sparse pseudo division

The sprem command performs sparse fraction-free pseudo division on polynomials.  In previous versions of Maple, sprem(f,g,x) would multiply by lcoeff(g,x) in each division step.  In Maple 2017, sprem has been changed to compute gcds and use the smallest possible multiplier, allowing it to handle problems of much higher degree with less blowup.  When degree(g)=degree(g,x) the command calls a dedicated division routine written in C.  The example below runs about 360 times faster, and finds a multiplier that is 19x shorter.

frandpolyx,degree=10000,terms=102:g  randpolyx,degree=5000,terms=102:timespremf,g,x,'m';lengthm

0.156

225

(3.1)

gcdex - extended Euclidean algorithm

For univariate polynomials, gcdex now uses a sparse primitive polynomial remainder sequence together with the new code for sprem.  For sparse structured problems the new routine is orders of magnitude faster.  The example below was previously intractable.

f128x203625591465x1961379565483492966x18969051360012922713930x182+503269676439575515122310x175358607771626419731119489079x168147952840877635699778667316508x1611147922766589841137530437873498x1543283047528072876955188179107557x1475494471139223382529181506689788x1406295323446544817875033709377526x1335439730226339556502298385195313x1264047134740954486045236505654710x1192699447938384037396439601445910x1121005987107212742027676051174393x105+1005987107212742027676051174393x98+2699447938384037396439601445910x91+4047134740954486045236505654710x84+5439730226339556502298385195313x77+6295323446544817875033709377526x70+5494471139223382529181506689788x63+3283047528072876955188179107557x56+1147922766589841137530437873498x49+147952840877635699778667316508x42+358607771626419731119489079x35503269676439575515122310x28+69051360012922713930x21+1379565483492966x14+625591465x7128:timegcdexxf,f,x,'inv'

0.031

(4.1)

Expand, Quo, and, Rem mod p

Expansion of fk mod p has been optimized in the case where p is a prime and kp, using the Frobenius map a+bp =ap+bp. The expansion below previously took a few seconds but is now instantaneous.  Quo and Rem have also been improved for multivariate polynomials and the division below runs about 90x faster.

fExpandx3+yz+z+yy+xz4mod7:g  CodeTools:-UsageExpandf50mod7:

memory used=75.71KiB, alloc change=0 bytes, cpu time=78.00ms, real time=140.00ms, gc time=0ns

rCodeTools:-UsageRemg,f,x,'q'mod7:

memory used=13.05KiB, alloc change=0 bytes, cpu time=16.00ms, real time=4.00ms, gc time=0ns

normal

Maple 2017 includes a powerful new algorithm for simplifying large multivariate rational expressions using normal.  Previous versions of Maple could not do this problem automatically.

unassign'g':

s1l2ga223l1ga12a21a222l2n22a21a222+l2n11a21a222+2l2ga12a222l1ga12a222+l2g2a222l2n11n22a222+l2n11a222+l1n22a12a212a22l1n11a12a212a22l2ga212a22l1ga122a21a22l2g2a12a21a22l1g2a12a21a22+l2n11n22a12a21a22+l1n11n22a12a21a222l2n22a12a21a22+l1n22a12a21a22+l2n11a12a21a222l1n11a12a21a22l2ga21a22+l2ga122a22l1ga122a22+l2g2a12a22l1g2a12a22l2n11n22a12a22+l1n11n22a12a22+l2n11a12a22l1n11a12a22+l1ga12a213+l1g2a122a212l1n11n22a122a212+l1n22a122a212l2ga12a212+2l1ga12a212l2g2a122a21+l1g2a122a21+l2n11n22a122a21l1n11n22a122a21l2n22a122a21+l1n22a122a21l2ga12a21+l1ga12a21l2ga12a21a222l1ga12a21a222l2n22a21a222+l1n22a21a222+l1l2ga12a222l1ga12a222l1l2n22a222+l1n22a222+l2n11a12a212a22l1n11a12a212a22l2ga212a22+l1ga212a22l1l2ga122a21a22+2l2ga122a21a22l1ga122a21a22+l1l2n22a12a21a222l2n22a12a21a22+l1n22a12a21a22+l1l2n11a12a21a22+l2n11a12a21a222l1n11a12a21a22l1l2ga21a22l2ga21a22+2l1ga21a22+l1l2ga122a22l1ga122a22l1l2n22a12a22+l1n22a12a22+l1l2n11a12a22l1n11a12a22l1l2ga22+l1ga22l1l2n11a122a212+l2n11a122a212+l1l2ga12a212l2ga12a212l1l2ga123a21+l2ga123a21+l1l2n22a122a21l2n22a122a21l1l2n11a122a21+l2n11a122a21+l1l2ga12a21l2ga12a21:s2l2ga12a222l2n22a222+l2a222l1ga122a21a22+l1n22a12a21a22+l2n11a12a21a22l2a12a21a22l1a12a21a22l2ga21a22+l2ga122a22l1ga122a22l2n22a12a22+l1n22a12a22+l2a12a22l1a12a22l1n11a122a212+l1a122a212+l1ga12a212+l2n11a122a21l1n11a122a21l2a122a21+l1a122a21l2ga12a21+l1ga12a21l2ga12a222ga12a222l2n22a222+n22a222l1ga122a21a22+ga122a21a22+l1n22a12a21a22n22a12a21a22+l2n11a12a21a22n11a12a21a22l2ga21a22+ga21a22+l2ga122a22ga122a22l2n22a12a22+n22a12a22+l2n11a12a22n11a12a22l2ga22+ga22l1n11a122a212+n11a122a212+l1ga12a212ga12a212l1ga123a21+ga123a21+l1n22a122a21n22a122a21l1n11a122a21+n11a122a21+l1ga12a21ga12a21:s3l2p21a223l1p21a12a21a222l2p22a21a222+l2p11a21a222+2l2p21a12a222l1p21a12a222l2p11p22a222+l2p12p21a222+l2p11a222+l1p22a12a212a22l1p11a12a212a22l2p12a212a22l1p21a122a21a22+l2p11p22a12a21a22+l1p11p22a12a21a222l2p22a12a21a22+l1p22a12a21a22l2p12p21a12a21a22l1p12p21a12a21a22+l2p11a12a21a222l1p11a12a21a22l2p12a21a22+l2p21a122a22l1p21a122a22l2p11p22a12a22+l1p11p22a12a22+l2p12p21a12a22l1p12p21a12a22+l2p11a12a22l1p11a12a22+l1p12a12a213l1p11p22a122a212+l1p22a122a212+l1p12p21a122a212l2p12a12a212+2l1p12a12a212+l2p11p22a122a21l1p11p22a122a21l2p22a122a21+l1p22a122a21l2p12p21a122a21+l1p12p21a122a21l2p12a12a21+l1p12a12a21l2p21a12a21a222l1p21a12a21a222l2p22a21a222+l1p22a21a222+l1l2p21a12a222l1p21a12a222l1l2p22a222+l1p22a222+l2p11a12a212a22l1p11a12a212a22l2p12a212a22+l1p12a212a22l1l2p21a122a21a22+2l2p21a122a21a22l1p21a122a21a22+l1l2p22a12a21a222l2p22a12a21a22+l1p22a12a21a22+l1l2p11a12a21a22+l2p11a12a21a222l1p11a12a21a22l1l2p12a21a22l2p12a21a22+2l1p12a21a22+l1l2p21a122a22l1p21a122a22l1l2p22a12a22+l1p22a12a22+l1l2p11a12a22l1p11a12a22l1l2p12a22+l1p12a22l1l2p11a122a212+l2p11a122a212+l1l2p12a12a212l2p12a12a212l1l2p21a123a21+l2p21a123a21+l1l2p22a122a21l2p22a122a21l1l2p11a122a21+l2p11a122a21+l1l2p12a12a21l2p12a12a21:s4l2p21a12a222l2p22a222+l2a222l1p21a122a21a22+l1p22a12a21a22+l2p11a12a21a22l2a12a21a22l1a12a21a22l2p12a21a22+l2p21a122a22l1p21a122a22l2p22a12a22+l1p22a12a22+l2a12a22l1a12a22l1p11a122a212+l1a122a212+l1p12a12a212+l2p11a122a21l1p11a122a21l2a122a21+l1a122a21l2p12a12a21+l1p12a12a21l2p21a12a222p21a12a222l2p22a222+p22a222l1p21a122a21a22+p21a122a21a22+l1p22a12a21a22p22a12a21a22+l2p11a12a21a22p11a12a21a22l2p12a21a22+p12a21a22+l2p21a122a22p21a122a22l2p22a12a22+p22a12a22+l2p11a12a22p11a12a22l2p12a22+p12a22l1p11a122a212+p11a122a212+l1p12a12a212p12a12a212l1p21a123a21+p21a123a21+l1p22a122a21p22a122a21l1p11a122a21+p11a122a21+l1p12a12a21p12a12a21:resl1l2p11p22q12q42+l2p11p22q12q42+l1p11p22q12q42p11p22q12q42+l1l2p12p21q12q42l2p12p21q12q42l1p12p21q12q42+p12p21q12q42+l1n22p11p22q1q42n22p11p22q1q42+l2n11p11p22q1q42n11p11p22q1q42l2p11p22q1q42l1p11p22q1q42+2p11p22q1q42l1n22p12p21q1q42+n22p12p21q1q42l2n11p12p21q1q42+n11p12p21q1q42+l2p12p21q1q42+l1p12p21q1q422p12p21q1q42+g2p11p22q42n11n22p11p22q42+n22p11p22q42+n11p11p22q42p11p22q42g2p12p21q42+n11n22p12p21q42n22p12p21q42n11p12p21q42+p12p21q42+l1l2n11p22q1q2q3q4l2n11p22q1q2q3q4l1n11p22q1q2q3q4+n11p22q1q2q3q4l1l2gp21q1q2q3q4+l2gp21q1q2q3q4+l1gp21q1q2q3q4gp21q1q2q3q4l1l2gp12q1q2q3q4+l2gp12q1q2q3q4+l1gp12q1q2q3q4gp12q1q2q3q4+l1l2n22p11q1q2q3q4l2n22p11q1q2q3q4l1n22p11q1q2q3q4+n22p11q1q2q3q4+l1g2p22q2q3q4g2p22q2q3q4l1n11n22p22q2q3q4+n11n22p22q2q3q4+l1n11p22q2q3q4n11p22q2q3q4l2gp21q2q3q4+gp21q2q3q4l1gp12q2q3q4+gp12q2q3q4+l2g2p11q2q3q4g2p11q2q3q4l2n11n22p11q2q3q4+n11n22p11q2q3q4+l2n22p11q2q3q4n22p11q2q3q4l1l2n11p22q1q3q4+l1n11p22q1q3q4+l1l2p22q1q3q4l1p22q1q3q4+l1l2gp21q1q3q4l1gp21q1q3q4+l1l2gp12q1q3q4l2gp12q1q3q4l1l2n22p11q1q3q4+l2n22p11q1q3q4+l1l2p11q1q3q4l2p11q1q3q4l1g2p22q3q4+l1n11n22p22q3q4l1n22p22q3q4l1n11p22q3q4+l1p22q3q4l2g2p11q3q4+l2n11n22p11q3q4l2n22p11q3q4l2n11p11q3q4+l2p11q3q4l1n22p11p22q1q2q4+n22p11p22q1q2q4l2n11p11p22q1q2q4+n11p11p22q1q2q4+l2n11p22q1q2q4n11p22q1q2q4+l1n22p12p21q1q2q4n22p12p21q1q2q4+l2n11p12p21q1q2q4n11p12p21q1q2q4l1gp21q1q2q4+gp21q1q2q4l2gp12q1q2q4+gp12q1q2q4+l1n22p11q1q2q4n22p11q1q2q42g2p11p22q2q4+2n11n22p11p22q2q4n22p11p22q2q4n11p11p22q2q4+g2p22q2q4n11n22p22q2q4+n11p22q2q4+2g2p12p21q2q42n11n22p12p21q2q4+n22p12p21q2q4+n11p12p21q2q4gp21q2q4gp12q2q4+g2p11q2q4n11n22p11q2q4+n22p11q2q4+2l1l2p11p22q12q4l2p11p22q12q4l1p11p22q12q4l1l2p22q12q4+l1p22q12q42l1l2p12p21q12q4+l2p12p21q12q4+l1p12p21q12q4l1l2p11q12q4+l2p11q12q4l1n22p11p22q1q4l2n11p11p22q1q4+l2p11p22q1q4+l1p11p22q1q4+l1n22p22q1q4l1p22q1q4+l1n22p12p21q1q4+l2n11p12p21q1q4l2p12p21q1q4l1p12p21q1q4+l1gp21q1q4+l2gp12q1q4+l2n11p11q1q4l2p11q1q4+l1l2g2q22q32l2g2q22q32l1g2q22q32+g2q22q32l1l2n11n22q22q32+l2n11n22q22q32+l1n11n22q22q32n11n22q22q322l1l2g2q2q32+l2g2q2q32+l1g2q2q32+2l1l2n11n22q2q32l2n11n22q2q32l1n11n22q2q32l1l2n22q2q32+l1n22q2q32l1l2n11q2q32+l2n11q2q32+l1l2g2q32l1l2n11n22q32+l1l2n22q32+l1l2n11q32l1l2q32l1g2p22q22q3+g2p22q22q3+l1n11n22p22q22q3n11n22p22q22q3l2g2p11q22q3+g2p11q22q3+l2n11n22p11q22q3n11n22p11q22q3+l2g2q22q3+l1g2q22q32g2q22q3l2n11n22q22q3l1n11n22q22q3+2n11n22q22q3l1l2n11p22q1q2q3+l2n11p22q1q2q3+l1l2gp21q1q2q3l2gp21q1q2q3+l1l2gp12q1q2q3l1gp12q1q2q3l1l2n22p11q1q2q3+l1n22p11q1q2q3+l1l2n22q1q2q3l1n22q1q2q3+l1l2n11q1q2q3l2n11q1q2q3+l1g2p22q2q3l1n11n22p22q2q3+l1n22p22q2q3+l2gp21q2q3+l1gp12q2q3+l2g2p11q2q3l2n11n22p11q2q3+l2n11p11q2q3l2g2q2q3l1g2q2q3+l2n11n22q2q3+l1n11n22q2q3l1n22q2q3l2n11q2q3+l1l2n11p22q1q3l1l2p22q1q3l1l2gp21q1q3l1l2gp12q1q3+l1l2n22p11q1q3l1l2p11q1q3l1l2n22q1q3l1l2n11q1q3+2l1l2q1q3+g2p11p22q22n11n22p11p22q22g2p22q22+n11n22p22q22g2p12p21q22+n11n22p12p21q22g2p11q22+n11n22p11q22+g2q22n11n22q22+l1n22p11p22q1q2+l2n11p11p22q1q2l1n22p22q1q2l2n11p22q1q2l1n22p12p21q1q2l2n11p12p21q1q2l1n22p11q1q2l2n11p11q1q2+l1n22q1q2+l2n11q1q2l1l2p11p22q12+l1l2p22q12+l1l2p12p21q12+l1l2p11q12l1l2q12:

exprsubsq1=s1,q2=s2,q3=s3,q4=s4,res:CodeTools:-Usagenormalexpr

memory used=5.20MiB, alloc change=0 bytes, cpu time=219.00ms, real time=253.00ms, gc time=0ns

0

(6.1)

indets, coeffs, degree, and miscellaneous

The indets command is used to find the variables or all subexpressions of a given type.  This is linear time in the size of the expression, but in previous versions of Maple, it was quadratic in the size of the set returned.  Maple now creates the set in linear time and sorts it in On log n time.  This example of calling indets on a linear system runs about 17 times faster in Maple 2017.

rrand1..104:eqns  seqaddrxr,j=1..10=r,i=1..104:timeindetseqns

0.031

(7.1)

The coeffs command extracts the coefficients of a polynomial and the degree command computes the degree.  Both commands were quadratic in the number of variables in previous versions, but in Maple 2017 they are linear.  These examples run about 15 times faster in Maple 2017.

faddrandxi,i=1..104:X  indetsf:timecoeffsf,X;timedegreef,X

0.

0.015

(7.2)

Checking for polynomials and rational expressions is implemented in the kernel for simple types, but for arbitrary Maple types it uses library code.  The library code was improved in Maple 2017 and the following examples run about twice as fast.

frandpolyx,y,RootOfz22,'degree'=20,'terms'=104:timetypef, 'polynom''algnum',x,y,z;timetypef, 'ratpoly''algnum',x,y,z

0.015

0.031

(7.3)

Testing for expanded polynomials now uses a kernel routine, which is much faster for large polynomials.  This test would have previously taken a second or two and is now instantaneous.

fexpandmulrandpolyi,degree=80, 'dense',i=x,y,z:timetypef, 'expanded'

0.

(7.4)

solve command and Groebner Bases

Maple 2017 includes a new compiled C implementation of the FGLM algorithm for computing a lexicographic Groebner basis from a total degree basis when there are a finite number of solutions.  This routine is used automatically by Groebner:-Basis when applicable and by the solve command when solving polynomial systems.  The example below runs about 200 times faster in Maple 2017.

cyclic7  x0+x1+x2+x3+x4+x5+x6,                    x0 x1+x0 x6+x1 x2+x2 x3+x3 x4+x4 x5+x5 x6,                    x0 x1 x2+x0 x1 x6+x0 x5 x6+x1 x2 x3+x2 x3 x4+x3 x4 x5+x4 x5 x6,                    x0 x1 x2 x3+x0 x1 x2 x6+x0 x1 x5 x6+x0 x4 x5 x6+x1 x2 x3 x4+x2 x3 x4 x5+x3 x4 x5 x6,                    x0 x1 x2 x3 x4+x0 x1 x2 x3 x6+x0 x1 x2 x5 x6+x0 x1 x4 x5 x6+x0 x3 x4 x5 x6+x1 x2 x3 x4 x5+x2 x3 x4 x5 x6,                    x0 x1 x2 x3 x4 x5+x0 x1 x2 x3 x4 x6+x0 x1 x2 x3 x5 x6+x0 x1 x2 x4 x5 x6+x0 x1 x3 x4 x5 x6+x0 x2 x3 x4 x5 x6+x1 x2 x3 x4 x5 x6,                    x0 x1 x2 x3 x4 x5 x61: L  CodeTools:-Usage Groebner:-Basiscyclic7, 'plex'x0,x1,x2,x3,x4,x5,x6 :

memory used=0.75GiB, alloc change=187.49MiB, cpu time=5.82s, real time=4.99s, gc time=358.80ms

The default strategy for computing Groebner bases in lexdeg orderings has been changed to direct computation with the F4 algorithm.  These orderings eliminate variables but do not triangularize the entire system.  The new strategy avoids the intermediate step of computing a total degree Groebner basis and the relatively slow conversion process in the positive dimensional case.  The example below runs about 10 times faster.

m'm':

circles  1 z2+w+m12m2,                    x2+y2m2,                  1 xm2+w2m2,                 1 mz22+w12y2m22m2,                  z24+12y2m22m2:

GCodeTools:-UsageGroebner:-Basiscircles, 'lexdeg'x,y,z,w,m:

memory used=1.59MiB, alloc change=0 bytes, cpu time=156.00ms, real time=74.00ms, gc time=0ns