Question: patmatch perfomance

Hej guys,

in some of my Maple worksheets I'm using Maples fit-function to obtain a rational function fit to some data, as I'm interested in the zeros of enumerator and denominator, I chose my fit function accordingly. Afterwards I need to extract the results (mainly the zeros) and do some more calculation steps with them. When evaluating rational functions of high degree, I noticed that my way of extracting the results (I'm using patmatch) becomes increasingly slow up to the point where it takes a couple of minutes to extract 10 numbers.
E.g. the following minimal example (download link at the bottom) takes more than 20 minutes on my machine (Maple 18.01 Build ID 935137; Red Hat Version 6.6 running on system with an i5-3570, 8 GB of RAM). Additionally, the calculation requires an unreasonable amount of RAM.
I can work around the problem to some degree by extracting the leading coefficient beforehand, resulting in a substantial speed up, still I think that there might be some error in the code or my usage of patmatch.

Is there another way to extract these numbers in a similarly simple fashion?

Cheers,

Sören


restart

a pathmatch with 9 variables requires roughly 200 MB of memory and takes about 7 s to finish on an i5-3570 CPU:

p := (1+x)*(2+x)*(3+x)*(4+x)*(5+x)/((11+x)*(12+x)*(13+x)*(14+x));

(1+x)*(2+x)*(3+x)*(4+x)*(5+x)/((11+x)*(12+x)*(13+x)*(14+x))

(1)

pattern := (a__1::realcons+x)*(a__2::realcons+x)*(a__3::realcons+x)*(a__4::realcons+x)*(a__5::realcons+x)/((b__1::realcons+x)*(b__2::realcons+x)*(b__3::realcons+x)*(b__4::realcons+x)); patmatch(p, pattern, 'la'); assign(la)

(a__1::realcons+x)*(a__2::realcons+x)*(a__3::realcons+x)*(a__4::realcons+x)*(a__5::realcons+x)/((b__1::realcons+x)*(b__2::realcons+x)*(b__3::realcons+x)*(b__4::realcons+x))

 

true

(2)

a__1; a__2; a__3; a__4; a__5; b__1; b__2; b__3; b__4

1

 

2

 

3

 

4

 

5

 

11

 

12

 

13

 

14

(3)

a pathmatch with 9 variables requires roughly 2.2 GB (!) of memory and takes about 20 min (!) to finish on an i5-3570 CPU:

q := 9*p;

9*(1+x)*(2+x)*(3+x)*(4+x)*(5+x)/((11+x)*(12+x)*(13+x)*(14+x))

(4)

a__1 := 'a__1':

(a__1::realcons+x)*(a__2::realcons+x)*(a__3::realcons+x)*(a__4::realcons+x)*(a__5::realcons+x)*a::realcons/((b__1::realcons+x)*(b__2::realcons+x)*(b__3::realcons+x)*(b__4::realcons+x))

 

true

(5)

a;

1

 

1

 

2

 

3

 

4

 

5

 

11

 

12

 

13

 

14

(6)

NULL

Download patmatch-breakdown.mw

Please Wait...