home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.math.symbolic      Symbolic algebra discussion      10,432 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,471 of 10,432   
   j4n bur53 to clicliclic@freenet.de   
   =?UTF-8?Q?Re:_Test_Cases_for_Gr=c3=b6bne   
   11 Jun 17 04:35:50   
   
   From: janburse@fastmail.fm   
      
   I am unable to run derive 6.10 on my windows 10 machine.   
   On the other hand I could run maxima, which has a groebner   
   basis library, and I get:   
      
   (%i27)   
   poly_buchberger([(5+(5+a^2)*b-a*b^2)*t,(5*a^2*b-(a+4*a^2)*b^2)*(t-1)],[t,a,b]);   
   Evaluation took 0.3281 seconds (0.3281 elapsed) using 4.431 MB.   
   (%o27) [(-a*b^2*t)+a^2*b*t+5*b*t+5*t,   
            (-4*a^2*b^2*t)-a*b^2*t+5*a^2*b*t+4*a^2*b^2+a*b^2   
                          -5*a^2*b,   
            4*a*b^3*t-4*a*b^2*t-20*b^2*t+5*b*t+25*t-4*a^2*b^2   
                     -a*b^2+5*a^2*b,   
            20*a*b^2*t+5*b^2*t-5*a*b*t+5*b*t-25*a*t-4*a^2*b^3   
                      -a*b^3+4*a^3*b^2+6*a^2*b^2-5*a^3*b,   
            (-5*b^2*t)+10*a*b*t-105*b*t-25*a^2*t+25*a*t-100*t   
                      -4*a^3*b^3+3*a^2*b^3+a*b^3+4*a^4*b^2   
                      +2*a^3*b^2+14*a^2*b^2+5*a*b^2-5*a^4*b   
                      +5*a^3*b-25*a^2*b,   
            (-20*b^3*t)-405*b^2*t+85*a*b*t+115*b*t-75*a*t+500*t   
                       +16*a^2*b^4+4*a*b^4-16*a^3*b^3   
                       -36*a^2*b^3-3*a*b^3+32*a^3*b^2   
                       -62*a^2*b^2-20*a*b^2-15*a^3*b+100*a^2*b,   
            4*a^3*b^4+a^2*b^4-4*a^4*b^3-6*a^3*b^3-20*a^2*b^3   
                     -5*a*b^3+5*a^4*b^2+5*a^2*b^2-5*a*b^2   
                     +25*a^2*b,   
            340*b^4*t+7100*b^3*t+2760*b^2*t-9375*b*t-1000*a*t   
                     -5375*t-272*a^2*b^5-68*a*b^5+272*a^3*b^4   
                     +440*a^2*b^4+8*a*b^4-372*a^3*b^3   
                     +1152*a^2*b^3+300*a*b^3+200*a^3*b^2   
                     -600*a^2*b^2+215*a*b^2-200*a^3*b   
                     -1075*a^2*b,   
            20*b^5*t+400*b^4*t-220*b^3*t-975*b^2*t+250*b*t   
                    +625*t-16*a^2*b^6-4*a*b^6+16*a^3*b^5   
                    +40*a^2*b^5+4*a*b^5-36*a^3*b^4+56*a^2*b^4   
                    +20*a*b^4+20*a^3*b^3-120*a^2*b^3-5*a*b^3   
                    -75*a^2*b^2-25*a*b^2+125*a^2*b]   
      
   The lcm is the polynomial 4*a^3*b^4 + .... Probably indeed   
   a nasty example, 0.3281 secs isn´t that fast. Nevertheless   
   I need to check what heuristic I am missing.   
      
   I also get spoaradic memory overflows for this example,   
   its a little monster that bugs me.   
      
   P.S.: was using the following maxima loads and flags:   
      
   (%i1) load(grobner);   
      
   (%i21) showtime:true;   
      
   (%i24) display2d:false;   
      
   (%i26) linel:60;   
      
      
   clicliclic@freenet.de schrieb:   
   >   
   > bursejan@gmail.com schrieb:   
   >>   
   >> I am using a Gröbner Bases algorithm to compute the   
   >> GCD of two multi-variate polynomials.   
   >> For two polynomials p,q just apply the algorithm   
   >> to [p*t,q*(1-t)] where t is a fresh variable,   
   >> you can then read of the LCM, and from this get   
   >> the GCD. I am currently experimenting with a randpoly   
   >> to generate test cases, and observed the Gröbner Bases   
   >> algorithm I am using has extremly varying runtime,   
   >> for polynomials of degree 3 it varies from a few millis   
   >> to a few secs. I read already about this horrible   
   >> complexity issue and in some cases heuristics might help.   
   >> For example this co-prime case runs through the roof:   
   >>   
   >> ?- X is 5+(5+A^2)*B-A*B^2,   
   >> Y is 5*A^2*B-(A+4*A^2)*B^2,   
   >> time(Z is X/Y).   
   >>   
   >> % Up 5,878 ms, GC 442 ms, Thread Cpu 5,438 ms (Current 06/08/17 01:07:39)   
   >>   
   >> Z is (1+1/4+(1+1/4+1/4*A^2)*B-1/4*A*B^2)/((1+1/4)*A^2*B-(1/4*A+A^2)*B^2)   
   >>   
   >> Any test cases around, that also show the corners of   
   >> the various heuristics that are around. Note: I am using   
   >> a very simple lexical ordering for the moment, different   
   >> orderings could of course also help.   
   >>   
   >   
   > Five seconds for the GCD or LCM of low-degree bivariate polynomials is   
   > absolutely ridiculous.   
   >   
   > Using its POLY_GCD procedure, Derive 6.10 instantaneously (a fraction of   
   > a millisecond on a modern CPU) finds:   
   >   
   >   POLY_GCD(5 + (5 + a^2)+b - a*b^2, 5*a^2*b - (a + 4*a^2)*b^2)   
   >    = 1   
   >   
   > and, using its GROEBNER_BASIS procedure, somewhat less instantaneously   
   > (a few milliseconds on a modern CPU) finds:   
   >   
   >   FIRST(GROEBNER_BASIS([(5 + (5 + a^2) + b - a*b^2)*t,   
   >     (5*a^2*b - (a + 4*a^2)*b^2)*(1 - t)], [t]))   
   >    = a^4*(4*b^2 - 5*b) - a^3*(4*b^4 - 5*b^3 - b^2)   
   >      - a^2*(b^4 - 4*b^3 - 35*b^2 + 50*b) + a*(b^3 + 10*b^2)   
   >   
   > the result equalling the negated product of the two polynomials:   
   >   
   >   - (5 + (5 + a^2) + b - a*b^2)*(5*a^2*b - (a + 4*a^2)*b^2).   
   >   
   > Experiments with larger bivariate polynomials confirm that Derive's   
   > POLY_GCD procedure can easily be orders of magnitude faster than the   
   > equivalent LCM computation relying on its GROEBNER_BASIS procedure. No   
   > wonder, actually, since the size of the unused basis elements can easily   
   > exceed the size of the decisive first element by orders of magnitude.   
   >   
   > Martin.   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca