Efficiency Improvements in Maple 16
Maple 16 includes a number of efficiency improvements for polynomial computations.
Polynomial arithmetic
Polynomial factorization
Polynomial ideal decomposition
Numerical PDE solutions with compile
Over the past couple of releases, the efficiency of polynomial arithmetic in Maple has been improved dramatically:
Multiplication and powering (expand, Expand mod n, Power mod n, Powmod)
Exact division (divide, Divide mod n)
Univariate and multivariate polynomials with integer coefficients
Dense and sparse polynomials
This has been achieved through a combination of various techniques:
New fast heap-based and memory efficient algorithms implemented in C
New compact internal polynomial data structure
Multithreading and exploiting cache locality
Together, these improvements have lead to sequential speedup factors of up to 22 compared to earlier Maple releases and up to 1800 compared to the latest release of Mathematica®. Maple's parallel implementations provide even higher speedups and scale well with the number of cores.
Computation times
Multiplication, dense, 3 variables, degree 30
M14: 0.65s
M15: 0.73s
M16: 0.52s
Mathematica 8: 110s
Speedup M16/M14: 1.3
Speedup M16/Mathematica8: 210
Division, dense, 3 variables, (degree 60 / degree 30)
M14: 0.88s
M15: 0.75s M16: 0.54s Mathematica 8: 84s
Speedup M16/M14: 1.6
Speedup M16/Mathematica8: 160
Univariate multiplication, sparse, degree 100000, 1000 terms
M14: 0.27s M15: 0.28s M16: 0.21s Mathematica 8: 3.0s
Speedup M16/Mathematica8: 14
Univariate division, sparse, (degree 200000) / (degree 100000), (180000 terms) / (1000 terms)
M14: 0.27s M15: 0.25s M16: 0.20s Mathematica 8: 78s
Speedup M16/M14: 1.4
Speedup M16/Mathematica8: 390
Non-divisibility test, dense, 3 variables, degree 60/degree 30
M14: 0.99s M15: 0.090s M16: 0.046s Mathematica 8: 84s
Speedup M16/M14: 22
Speedup M16/Mathematica8: 1800
Modular division, dense, 4 variables, 512 bit prime,degree 30/linear
M14: 2.0s
M15: 0.16s
M16: 0.11s
Mathematica 8: 2.5s
Speedup M16/M14: 18
Speedup M16/Mathematica8: 23
Univariate powering modulo a polynomial and a 31 bit prime, dense, degree 1024
M14: 0.7s
M15: 0.26s
Mathematica 8: freezes computer
Speedup M16/M14: 6.4
Computation times on multiple cores
Multiplication, dense, 4 variables, degree 20
M16, 1 core: 13s
M16, 2 cores: 7.5s
M16, 4 cores: 4.8s
Speedup 4 cores: 2.7
Division, dense, 4 variables, (degree 20) / (degree 10)
M16, 1 core: 14s
M16, 2 cores: 7.7s
M16, 4 cores: 4.4s
Speedup 4 cores: 3.2
Maple has two commands for polynomial factorization, i.e., the multiplicative decomposition of a multivariate polynomial into irreducible factors that cannot be decomposed any further. The simplest case is that of a univariate polynomial with integer coefficients, using the factor command:
factorx8−1
x−1⁢x+1⁢x2+1⁢x4+1
Note that the resulting factors have integer coefficients as well. For example, x2+1 is not split any further into x−ⅈx+ⅈ. To obtain a more refined factorization, you can use a second argument to specify what you want to allow in the coefficients:
factorx8−1,ⅈ
x2+I⁢−x2+I⁢−x+I⁢x+I⁢x−1⁢x+1
In the most general case, the polynomial can have more than one variable and may already contain non-rational expressions such as ⅈ or 2 or t−2, which can even be nested or involve parameters (such as t in the example) in the coefficients. Such cases are handled by the command evala(Factor(...)). Note, however, that this command generally requires all radicals to be expressed in RootOf form:
r≔RootOf_Z2−t
RootOf⁡_Z2−t
factorx2−2 r x+t
x2−2⁢RootOf⁡_Z2−t⁢x+t
evalaFactorx2−2 r x+t
x−RootOf⁡_Z2−t2
In Maple 16, the computational efficiency of the evala(Factor(...)) command has been improved dramatically, in particular in the presence of multiple and nested RootOfs. The speedup is due to a new and efficient sparse modular algorithm. For example, the execution time for the following example is about 20 times faster than in Maple 15 on the same machine.
restart:randomize1:
z1≔convert2,RootOf
RootOf⁡_Z2−2,index=1
z2≔convertt1/3,RootOf
RootOf⁡_Z3−t,index=1
f≔evalaReducerandpolyx,y,z1,z2,t
34⁢y2⁢RootOf⁡_Z2−2,index=1−20⁢x⁢y2⁢RootOf⁡_Z2−2,index=1+93⁢x3⁢RootOf⁡_Z2−2,index=1⁢t+45⁢x3⁢t2+30⁢y3⁢RootOf⁡_Z3−t,index=12−56⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=1⁢t
g≔evalaReducerandpolyx,y,z1,z2,t
47⁢t2+40⁢x2⁢t+114⁢y⁢RootOf⁡_Z2−2,index=1+58⁢x3⁢y⁢t+43⁢x⁢y⁢RootOf⁡_Z3−t,index=12⁢t−98⁢t
h≔evalaExpandf g
21204⁢x3⁢y⁢t+1360⁢y2⁢RootOf⁡_Z2−2,index=1⁢x2⁢t+1972⁢y3⁢RootOf⁡_Z2−2,index=1⁢x3⁢t−940⁢x⁢y2⁢RootOf⁡_Z2−2,index=1⁢t2−800⁢x3⁢y2⁢RootOf⁡_Z2−2,index=1⁢t−1160⁢x4⁢y3⁢RootOf⁡_Z2−2,index=1⁢t+1960⁢x⁢y2⁢RootOf⁡_Z2−2,index=1⁢t+5394⁢x6⁢RootOf⁡_Z2−2,index=1⁢t2⁢y+5130⁢x3⁢t2⁢y⁢RootOf⁡_Z2−2,index=1+1935⁢x4⁢t3⁢y⁢RootOf⁡_Z3−t,index=12+1200⁢y3⁢RootOf⁡_Z3−t,index=12⁢x2⁢t+1740⁢y4⁢RootOf⁡_Z3−t,index=12⁢x3⁢t−2240⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=1⁢t2⁢x2+1290⁢t2⁢y4⁢RootOf⁡_Z3−t,index=1⁢x−2408⁢t3⁢RootOf⁡_Z2−2,index=1⁢x⁢y+1462⁢y3⁢RootOf⁡_Z2−2,index=1⁢x⁢RootOf⁡_Z3−t,index=12⁢t−860⁢x2⁢y3⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=12⁢t+3999⁢x4⁢RootOf⁡_Z2−2,index=1⁢t2⁢y⁢RootOf⁡_Z3−t,index=12−3248⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=1⁢t2⁢x3⁢y+2115⁢x3⁢t4+1800⁢x5⁢t3−4410⁢x3⁢t3−4560⁢x⁢y3+2610⁢x6⁢t3⁢y+1598⁢y2⁢RootOf⁡_Z2−2,index=1⁢t2−3332⁢y2⁢RootOf⁡_Z2−2,index=1⁢t+4371⁢x3⁢RootOf⁡_Z2−2,index=1⁢t3+3720⁢x5⁢RootOf⁡_Z2−2,index=1⁢t2−9114⁢x3⁢RootOf⁡_Z2−2,index=1⁢t2+1410⁢y3⁢RootOf⁡_Z3−t,index=12⁢t2+3420⁢y4⁢RootOf⁡_Z3−t,index=12⁢RootOf⁡_Z2−2,index=1−2940⁢y3⁢RootOf⁡_Z3−t,index=12⁢t−2632⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=1⁢t3+5488⁢RootOf⁡_Z2−2,index=1⁢RootOf⁡_Z3−t,index=1⁢t2−12768⁢RootOf⁡_Z3−t,index=1⁢t⁢y+7752⁢y3
CodeTools:-UsageevalaFactorh:
memory used=15.91MiB, alloc change=19.21MiB, cpu time=516.00ms, real time=4.50s
The following table shows some benchmarks in comparison to Maple 15.
Variables
RootOfs
Parameters
Total #indets
Degree
Terms
Maple 15
Maple 16
Speedup
x,y,z
RootOf_Z2−2, RootOf_Z3−3
−
5
10
36
5.0 s
0.21 s
24
x,y
RootOf_Z2−2, RootOf_Z3−t
t
6.1 s
0.34 s
18
134
18 s
0.36 s
50
276
29 s
0.68 s
43
20
24 s
0.42 s
57
30
220 s
0.40 s
550
RootOf_Z2−2, RoofOf_Z3−t⋅RootOf_Z2−2
7.6 s
11
RootOf_Z2−2, RootOf_Z2−3, RootOf_Z2−t
6
16 s
0.60 s
27
RootOf_Z2−s, RootOf_Z3−t
s,t
0.33 s
48
A generalization of the concept of factoring a single polynomial into its multiplicatively irreducible factors is the prime decomposition of a polynomial ideal, generated by a finite set of multivariate polynomials. Maple's PolynomialIdeals package provides, in addition to many useful commands and tools for manipulating and analyzing polynomial ideals, the PrimeDecomposition command, as well as the Radical command, which computes equivalent to the squarefree part for a polynomial ideal. The computational efficiency of these two commands was improved for Maple 15, leading to dramatic speedup factors of more than 700 in some cases.
The main improvements are new algorithms and heuristics to split the systems more frequently and, in some cases, run the factoring Buchberger algorithm. These enhancements apply in particular to positive-dimensional systems, i.e., systems with an infinite number of complex solutions.
For example, the following computation is faster than in Maple 15 by a factor of about 50 on the same machine:
restart:
withPolynomialIdeals:
wang92c ≔ −3 c d+b2−2 a+2, −3 c2d+b2c−a d+b, −3 a2d−4 b c+2 b2−6 a c+3 a b
−3⁢c⁢d+b2−2⁢a+2,−3⁢c2⁢d+b2⁢c−a⁢d+b,−3⁢a2⁢d−4⁢b⁢c+2⁢b2−6⁢a⁢c+3⁢a⁢b
CodeTools:-UsagePrimeDecompositionwang92c:
memory used=36.06MiB, alloc change=23.01MiB, cpu time=1.20s, real time=4.08s
Task
Problem
#Variables
Dimension
Max degree
prime decomposition
circles
1
2
6.8 s
0.82 s
8.3
vermeer
6.4 s
wang92c
4
3
45 s
0.84 s
54
ctoa
> 5 min
0.54 s
>550
butcher
7
>710
radical
0.57 s
>530
The compile option has been added to the numeric pdsolve command, to allow more efficient computation of PDE numerical solutions. See pdsolve[numeric] for more information.
Download Help Document