On Tue, Aug 18, 2009 at 4:56 PM, rjf<fate...@gmail.com> wrote:
>
>
> At the risk of providing some information about what is probably going
> on,
> let me suggest the following.
>
> 1. The expand() command in Maxima is almost always the wrong thing to
> do if the argument is a polynomial.
> ratexpand() or ratsimp() or rat()  will be much faster.  I suspect
> that in your timings of Maxima, the major
> contributor may be expand.

No, but it does contribute:

sage: sage: R.<x,y,z> = QQ[]
sage: n=30;a = ((x+y+z)^n+1)*((x+y+z)^n+2)
sage: time b=maxima(a)
CPU times: user 0.02 s, sys: 0.00 s, total: 0.02 s
Wall time: 1.86 s
sage: time c=b.expand()
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 2.18 s
sage: time d=c.factor()
CPU times: user 0.00 s,
Wall time: 7.33 s

>
> 2. This is not a good test of polynomial factoring, because it does
> uses only a trivial part of the algorithm,
> and that is the square-free factoring part, that consists of computing
> P' a derivative of P and a gcd(P,P').
>
> Mostly you are testing the gcd program, but only the case of the gcd
> program for gcd(a,b) where, almost all
> the time, a divides b.  So you are not even testing the gcd program,
> you are testing polynomial division with remainder.
>
> Now if that is what you want to test, fine.  If you want to test
> polynomial factoring, there is a substantial
> literature on how to choose polynomials that are difficult to factor.
> Especially large degree is not really necessary.

I'm sure that's one of the reasons that Sage beats all the other systems
by a large margin on this input.  It isn't one of the official
benchmark polynomials.  It's one I just made up at random.   I feel so
illicit :-)

> While it is only a speculation on my part, I think what you may also
> be timing is the conversion of
> relatively large character strings, at least in some cases.

That was in the above timing.  I've broken that apart above though:

  1.86 to convert a string
  2.18 to expand
  7.33 to factor

Maxima is definitely the fastest on this benchmark.

William

>
> I hope you can straighten this out before you present your results at
> your conference.
>
> RJF
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to