Le jeudi 27 novembre 2014 02:46:26 UTC+1, Robert Dodier a écrit :
>
> On 2014-11-26, Han Frederic <[email protected] <javascript:>> wrote:
>
> > Hi, I have tried the factorization with giacpy. (cf trac 12375).
> > I had to expexpand first before factoring and did this:
> >
> > sage: from giacpy import libgiac
> > sage: x=libgiac('x')
> > sage: s=exp(1024*(x+1))-1
> > sage: %time s.expexpand().factor()
> > CPU times: user 0 ns, sys: 0 ns, total: 0 ns
> > Wall time: 1.32 ms
> >
> (exp(x+1)-1)*(exp(x+1)+1)*(exp(x+1)^2+1)*(exp(x+1)^4+1)*(exp(x+1)^8+1)*(exp(x+1)^16+1)*(exp(x+1)^32+1)*(exp(x+1)^64+1)*(exp(x+1)^128+1)*(exp(x+1)^256+1)*(exp(x+1)^512+1)
>
>
>
> That's terrific. Do you know anything about the implementation of Giac?
> I downloaded the source code and after poking around a bit, I can't
> tell where factoring such an expression actually occurs. Does Giac
> handle that itself, or does it punt to PARI or something else?
> What is the effect of expexpand in the example above?
>
> Thanks for any information,
>
> Robert Dodier
>
> expexpand do this:
sage: s
exp(1024*(x+1))-1
sage: s.expexpand()
exp(x+1)^1024-1
so I guess that factor works as if it was a polynomial in one variable. (I
have asked on giac forum to obtain confirmation about the implementation
for one variable, but I think that for multivariable giac does it alone:
so I have tried this:
sage: x,y=libgiac('x,y')
sage: s=exp(1024*(x+1))-exp(768*(y+2))
sage: %time s.expexpand().factor()
CPU times: user 1.21 s, sys: 16 ms, total: 1.23 s
Wall time: 1.22 s
-(exp(y+2)^3-exp(x+1)^4)*(exp(y+2)^3+exp(x+1)^4)*(exp(y+2)^6+exp(x+1)^8)*(exp(y+2)^12+exp(x+1)^16)*(exp(y+2)^24+exp(x+1)^32)*(exp(y+2)^48+exp(x+1)^64)*(exp(y+2)^96+exp(x+1)^128)*(exp(y+2)^192+exp(x+1)^256)*(exp(y+2)^384+exp(x+1)^512)
best
Frederic
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.