1

I had Pari calculate some polynomials and write them in a file. Now I want to read them back in and I encounter

*** expression nested too deeply.

There are no loops in the file it is simply {P[n]=(some (Laurent) polynomial in q);} on the n-th line.

The file is only ~500 KB and I've read in much larger files.

I tried checking if there are errors and can't find them. Next I tried to simplify the file and read in the first hundred polynomials or so. This worked and then I tried to load just one of the larger polynomial in. It didn't work and then I removed some terms in the file and found that if a removed enough terms it could read it in.

For example I put in

default(parisize,10000000000);
P=vector(1000,i,0);
\r {filename}

or

default(parisize,10000000000);
P=vector(1000,i,0);
read(filename)

with the file just one line of the form

P[139]=(q^152352 + ... + 33495418*q^1184)/q^76176

here is can be read

with the file just one line exactly the same except an extra +1 as given

P[139]=(q^152352 + ... + 33495418*q^1184+1)/q^76176

it can't be read in.

Andrew
  • 873
  • 4
  • 10
Campbell
  • 11
  • 1

1 Answers1

0

I would suggest adding parenthesis every 100 or 1000 terms in the list of terms being summed, so that the number of pluses within one group is limited to some reasonable number. It seems like the expression parser is recursively calling it self with each + it encounters. You can reduce the the depth of recursion by inserting parenthesis.

Andrew
  • 873
  • 4
  • 10