Richard Robinson on Thu, 05 May 2022 07:34:11 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: slow factor


How and when is it to exit that loop?  It looks like an infinite loop script to me.  Or am I missing something?

Richard


On Wed, May 4, 2022 at 4:21 AM Zhao Li <zhaoli@ihep.ac.cn> wrote:
We have run it for about an hour but it still does not stop. It seems it got into an infinite loop.

We are using the version 2.13.4。
The complete script is

==========================
default(parisize, 1200000000);

fact(P) =
{
 my(x=variable(P),y=variable(Vec(P)));
 my(d=poldegree(P,y));
 my(C=content(P),FC=factor(C));
 for(i=1,oo,
   my(R=substpol(factor(subst(P/C,ieta,(x+i)^d)),(x+i)^d,ieta));
   R= matconcat([FC,R]~);
   my(F=factorback(R)*C);
   if(pollead(P)*F==pollead(F)*P,
     return(R)));
}


P = -400000*ieta + 3600000*ep*ieta + 4*ep*ieta^2 - 11300000*ep^2*ieta - 20*ep^2*ieta^2 + 15000000*ep^3*ieta + 33*ep^3*ieta^2 - 7200000*ep^4*ieta - 18*ep^4*ieta^2;
F = fact(P)
=======================

Cheers,
Zhao

Theoretical Physics Division
Institute of High Energy Physics
Chinese Academy of Sciences

> On May 4, 2022, at 5:36 PM, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
>
> On Wed, May 04, 2022 at 05:16:11PM +0800, Zhao Li wrote:
>> Dear Bill,
>>
>>      Thank you.
>>      In practice we can restrict the input polynomial in the integer ring.
>>      This function works very well. But we found it failed for this polynomial.
>>
>> P = -400000*ieta + 3600000*ep*ieta + 4*ep*ieta^2 - 11300000*ep^2*ieta - 20*ep^2*ieta^2 + 15000000*ep^3*ieta + 33*ep^3*ieta^2 - 7200000*ep^4*ieta - 18*ep^4*ieta^2;
>
> What is the problem ? It works for me:
>
> ? factorback(factor(P))==-P
> %2 = 1
> ? factorback(fact(P))==-P
> %3 = 1
>
> Maybe the issue is that P has square factors:
>
> ? fact(P)
> %4 = [ieta,1;2*ep-1,1;3*ep-2,2;(ieta+400000)*ep-100000,1]
>
> Cheers,
> Bill.