Date: Jan 7, 2013 12:35 AM
Author: Daniel Lichtblau
Subject: Re: PolynomialQuotient slow
On Saturday, January 5, 2013 1:17:29 AM UTC-6, Roman Pearce wrote:
> Thanks Daniel, the internal routine seems to be what I want, as its time
is comparable to Expand. And it is parallelized? This is very nice work.
Can I ask if it is recursive or distributed? I'd appreciate any references where I can read about it.
It is using the sparse recursive form.
The speed derives use of GMP integers rather than explicit Mathematica integers. Not much difference between these; the main thing is the memory management. At least that's what I've been told. From your experiments I guess it may also be using multiple processors. Offhand I do not see how, but it's Sunday...
The person to ask if you want more detail would be Adam Strzebonski. I don't think there is anything going on other than what I noted above, but if there is something smart in parallelization then yes, that would warrant more detail (at least, more than I can provide).
> Two things we noticed were that ExactQuotient sometimes uses more threads and gets better speedup than Expand, so it may be possible to improve Expand, and Factor doesn't seem to use the parallel algorithms which is something to consider if you haven't already.
I am not sure what the plan is there. It's a large job to tackle. But I agree the potential for improvement is substantial. I should add that to some extent it is already in Factor, and has been for a very long time. That is to say, the underlying sparse recursive division has been there. (I believe) the bulk of the further improvement comes from having GMP handle the allocation/deallocation stuff. It is this aspect that, I think, is not at this time inside Factor.
> f = Expand[ (1+x+y+z+t)^30+1 ]; g = f+1;
> AbsoluteTiming[ p = Algebra`IPExpand[ f g ]; ]
> AbsoluteTiming[ q = Algebra`IPExactQuotient[ p, f ]; ]
> We were also excited to see some of the other core algorithm improvements in Mathematica 9. I think you have a very strong release here. All the best in the new year :)
Same to you, Roman. Feel free to sent a note off-line if this does not cover all your questions.