Below are eight rational functions (s1, s2, ss1, etc.) and two polynomials (res and res1) in the variables l1, l2, n11, n22, g, p11, p12, p21, p22, q1, q2, q3, q4, a12, a21, a22. Each of the ssi is the same as the corresponding si with some of the variables substituted with constants (the same constants). They are writen in Maple format. The test is to verify that res evaluated at q1=s1, q2=s2, q3=s3, and q4=s4 is 0. Secondly, and easier, that res1 evaluated at q1=ss1, q2=ss2, q3=ss3, and q4=ss4 is 0. This is an actual problem that came up in image analysis. On my Mac PPC (233 mhz 604e) it takes 11 minutes and 200 meg of RAM to do the former. The latter takes 51 seconds and 22 meg of RAM. Both are done over the ground ring of integers. UPDATE: Oct 2007. That old Mac PPC 233 mhz has long since passed into history. On my relatively new Intel IMac (dual processor 2.1 ghz) the first takes 9.2 seconds. The second is too fast to bother measuring. Let me know how it goes on your system! s1 := (l2*g*a22^3-l1*g*a12*a21*a22^2-l2*n22*a21*a22^2+l2*n11*a21*a22^2+2*l2*g*a12*a22^2-\ l1*g*a12*a22^2+l2*g^2*a22^2-l2*n11*n22*a22^2+l2*n11*a22^2+l1*n22*a12*a21^2*a22-\ l1*n11*a12*a21^2*a22-l2*g*a21^2*a22-l1*g*a12^2*a21*a22-l2*g^2*a12*a21*a22-l1*g^2*\ a12*a21*a22+l2*n11*n22*a12*a21*a22+l1*n11*n22*a12*a21*a22-2*l2*n22*a12*a21*a22+\ l1*n22*a12*a21*a22+l2*n11*a12*a21*a22-2*l1*n11*a12*a21*a22-l2*g*a21*a22+l2*g*a12^2*\ a22-l1*g*a12^2*a22+l2*g^2*a12*a22-l1*g^2*a12*a22-l2*n11*n22*a12*a22+l1*n11*n22*\ a12*a22+l2*n11*a12*a22-l1*n11*a12*a22+l1*g*a12*a21^3+l1*g^2*a12^2*a21^2-l1*n11*\ n22*a12^2*a21^2+l1*n22*a12^2*a21^2-l2*g*a12*a21^2+2*l1*g*a12*a21^2-l2*g^2*a12^2*\ a21+l1*g^2*a12^2*a21+l2*n11*n22*a12^2*a21-l1*n11*n22*a12^2*a21-l2*n22*a12^2*a21+\ l1*n22*a12^2*a21-l2*g*a12*a21+l1*g*a12*a21)/(l2*g*a12*a21*a22^2-l1*g*a12*a21*a22^2-\ l2*n22*a21*a22^2+l1*n22*a21*a22^2+l1*l2*g*a12*a22^2-l1*g*a12*a22^2-l1*l2*n22*a22^2+\ l1*n22*a22^2+l2*n11*a12*a21^2*a22-l1*n11*a12*a21^2*a22-l2*g*a21^2*a22+l1*g*a21^2*\ a22-l1*l2*g*a12^2*a21*a22+2*l2*g*a12^2*a21*a22-l1*g*a12^2*a21*a22+l1*l2*n22*a12*\ a21*a22-2*l2*n22*a12*a21*a22+l1*n22*a12*a21*a22+l1*l2*n11*a12*a21*a22+l2*n11*a12*\ a21*a22-2*l1*n11*a12*a21*a22-l1*l2*g*a21*a22-l2*g*a21*a22+2*l1*g*a21*a22+l1*l2*\ g*a12^2*a22-l1*g*a12^2*a22-l1*l2*n22*a12*a22+l1*n22*a12*a22+l1*l2*n11*a12*a22-\ l1*n11*a12*a22-l1*l2*g*a22+l1*g*a22-l1*l2*n11*a12^2*a21^2+l2*n11*a12^2*a21^2+\ l1*l2*g*a12*a21^2-l2*g*a12*a21^2-l1*l2*g*a12^3*a21+l2*g*a12^3*a21+l1*l2*n22*a12^2*\ a21-l2*n22*a12^2*a21-l1*l2*n11*a12^2*a21+l2*n11*a12^2*a21+l1*l2*g*a12*a21-l2*\ g*a12*a21); s2 := (l2*g*a12*a22^2-l2*n22*a22^2+l2*a22^2-l1*g*a12^2*a21*a22+l1*n22*a12*a21*a22+\ l2*n11*a12*a21*a22-l2*a12*a21*a22-l1*a12*a21*a22-l2*g*a21*a22+l2*g*a12^2*a22-\ l1*g*a12^2*a22-l2*n22*a12*a22+l1*n22*a12*a22+l2*a12*a22-l1*a12*a22-l1*n11*a12^2*\ a21^2+l1*a12^2*a21^2+l1*g*a12*a21^2+l2*n11*a12^2*a21-l1*n11*a12^2*a21-l2*a12^2*\ a21+l1*a12^2*a21-l2*g*a12*a21+l1*g*a12*a21)/(l2*g*a12*a22^2-g*a12*a22^2-l2*n22*\ a22^2+n22*a22^2-l1*g*a12^2*a21*a22+g*a12^2*a21*a22+l1*n22*a12*a21*a22-n22*a12*\ a21*a22+l2*n11*a12*a21*a22-n11*a12*a21*a22-l2*g*a21*a22+g*a21*a22+l2*g*a12^2*\ a22-g*a12^2*a22-l2*n22*a12*a22+n22*a12*a22+l2*n11*a12*a22-n11*a12*a22-l2*g*a22+\ g*a22-l1*n11*a12^2*a21^2+n11*a12^2*a21^2+l1*g*a12*a21^2-g*a12*a21^2-l1*g*a12^3*\ a21+g*a12^3*a21+l1*n22*a12^2*a21-n22*a12^2*a21-l1*n11*a12^2*a21+n11*a12^2*a21+\ l1*g*a12*a21-g*a12*a21); s3 := (l2*p21*a22^3-l1*p21*a12*a21*a22^2-l2*p22*a21*a22^2+l2*p11*a21*a22^2+2*l2*p21*\ a12*a22^2-l1*p21*a12*a22^2-l2*p11*p22*a22^2+l2*p12*p21*a22^2+l2*p11*a22^2+l1*\ p22*a12*a21^2*a22-l1*p11*a12*a21^2*a22-l2*p12*a21^2*a22-l1*p21*a12^2*a21*a22+l2*\ p11*p22*a12*a21*a22+l1*p11*p22*a12*a21*a22-2*l2*p22*a12*a21*a22+l1*p22*a12*a21*a22-\ l2*p12*p21*a12*a21*a22-l1*p12*p21*a12*a21*a22+l2*p11*a12*a21*a22-2*l1*p11*a12*a21*\ a22-l2*p12*a21*a22+l2*p21*a12^2*a22-l1*p21*a12^2*a22-l2*p11*p22*a12*a22+l1*p11*\ p22*a12*a22+l2*p12*p21*a12*a22-l1*p12*p21*a12*a22+l2*p11*a12*a22-l1*p11*a12*a22+\ l1*p12*a12*a21^3-l1*p11*p22*a12^2*a21^2+l1*p22*a12^2*a21^2+l1*p12*p21*a12^2*a21^2-\ l2*p12*a12*a21^2+2*l1*p12*a12*a21^2+l2*p11*p22*a12^2*a21-l1*p11*p22*a12^2*a21-l2*\ p22*a12^2*a21+l1*p22*a12^2*a21-l2*p12*p21*a12^2*a21+l1*p12*p21*a12^2*a21-l2*p12*\ a12*a21+l1*p12*a12*a21)/(l2*p21*a12*a21*a22^2-l1*p21*a12*a21*a22^2-l2*p22*a21*\ a22^2+l1*p22*a21*a22^2+l1*l2*p21*a12*a22^2-l1*p21*a12*a22^2-l1*l2*p22*a22^2+l1*\ p22*a22^2+l2*p11*a12*a21^2*a22-l1*p11*a12*a21^2*a22-l2*p12*a21^2*a22+l1*p12*a21^2*\ a22-l1*l2*p21*a12^2*a21*a22+2*l2*p21*a12^2*a21*a22-l1*p21*a12^2*a21*a22+l1*l2*p22*\ a12*a21*a22-2*l2*p22*a12*a21*a22+l1*p22*a12*a21*a22+l1*l2*p11*a12*a21*a22+l2*p11*\ a12*a21*a22-2*l1*p11*a12*a21*a22-l1*l2*p12*a21*a22-l2*p12*a21*a22+2*l1*p12*a21*a22+\ l1*l2*p21*a12^2*a22-l1*p21*a12^2*a22-l1*l2*p22*a12*a22+l1*p22*a12*a22+l1*l2*p11*\ a12*a22-l1*p11*a12*a22-l1*l2*p12*a22+l1*p12*a22-l1*l2*p11*a12^2*a21^2+l2*p11*\ a12^2*a21^2+l1*l2*p12*a12*a21^2-l2*p12*a12*a21^2-l1*l2*p21*a12^3*a21+l2*p21*a12^3*\ a21+l1*l2*p22*a12^2*a21-l2*p22*a12^2*a21-l1*l2*p11*a12^2*a21+l2*p11*a12^2*a21+\ l1*l2*p12*a12*a21-l2*p12*a12*a21); s4 := (l2*p21*a12*a22^2-l2*p22*a22^2+l2*a22^2-l1*p21*a12^2*a21*a22+l1*p22*a12*a21*a22+\ l2*p11*a12*a21*a22-l2*a12*a21*a22-l1*a12*a21*a22-l2*p12*a21*a22+l2*p21*a12^2*\ a22-l1*p21*a12^2*a22-l2*p22*a12*a22+l1*p22*a12*a22+l2*a12*a22-l1*a12*a22-l1*\ p11*a12^2*a21^2+l1*a12^2*a21^2+l1*p12*a12*a21^2+l2*p11*a12^2*a21-l1*p11*a12^2*\ a21-l2*a12^2*a21+l1*a12^2*a21-l2*p12*a12*a21+l1*p12*a12*a21)/(l2*p21*a12*a22^2-\ p21*a12*a22^2-l2*p22*a22^2+p22*a22^2-l1*p21*a12^2*a21*a22+p21*a12^2*a21*a22+l1*\ p22*a12*a21*a22-p22*a12*a21*a22+l2*p11*a12*a21*a22-p11*a12*a21*a22-l2*p12*a21*\ a22+p12*a21*a22+l2*p21*a12^2*a22-p21*a12^2*a22-l2*p22*a12*a22+p22*a12*a22+l2*\ p11*a12*a22-p11*a12*a22-l2*p12*a22+p12*a22-l1*p11*a12^2*a21^2+p11*a12^2*a21^2+\ l1*p12*a12*a21^2-p12*a12*a21^2-l1*p21*a12^3*a21+p21*a12^3*a21+l1*p22*a12^2*a21-\ p22*a12^2*a21-l1*p11*a12^2*a21+p11*a12^2*a21+l1*p12*a12*a21-p12*a12*a21); ss1 := (4*g*a22^3-g*a12*a21*a22^2-4*n22*a21*a22^2+4*n11*a21*a22^2+7*g*a12*a22^2+4*g^2*a22^2-\ 4*n11*n22*a22^2+4*n11*a22^2+n22*a12*a21^2*a22-n11*a12*a21^2*a22-4*g*a21^2*a22-\ g*a12^2*a21*a22-5*g^2*a12*a21*a22+5*n11*n22*a12*a21*a22-7*n22*a12*a21*a22+2*n11*a12*\ a21*a22-4*g*a21*a22+3*g*a12^2*a22+3*g^2*a12*a22-3*n11*n22*a12*a22+3*n11*a12*a22+g*\ a12*a21^3+g^2*a12^2*a21^2-n11*n22*a12^2*a21^2+n22*a12^2*a21^2-2*g*a12*a21^2-3*g^2*\ a12^2*a21+3*n11*n22*a12^2*a21-3*n22*a12^2*a21-3*g*a12*a21)/(3*g*a12*a21*a22^2-3*n22*\ a21*a22^2+g*a12*a22^2-n22*a22^2+3*n11*a12*a21^2*a22-3*g*a21^2*a22+5*g*a12^2*a21*\ a22-5*n22*a12*a21*a22+4*n11*a12*a21*a22-4*g*a21*a22+g*a12^2*a22-n22*a12*a22+n11*\ a12*a22-g*a22+2*n11*a12^2*a21^2-2*g*a12*a21^2+2*g*a12^3*a21-2*n22*a12^2*a21+2*n11*\ a12^2*a21-2*g*a12*a21); ss2 := (4*g*a12*a22^2-4*n22*a22^2+4*a22^2-g*a12^2*a21*a22+n22*a12*a21*a22+4*n11*a12*a21*\ a22-5*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22-3*n22*a12*a22+3*a12*a22-n11*a12^2*a21^2+\ a12^2*a21^2+g*a12*a21^2+3*n11*a12^2*a21-3*a12^2*a21-3*g*a12*a21)/(2*g*a12*a22^2-\ 2*n22*a22^2+g*a12^2*a21*a22-n22*a12*a21*a22+2*n11*a12*a21*a22-2*g*a21*a22+2*g*a12^2*\ a22-2*n22*a12*a22+2*n11*a12*a22-2*g*a22+n11*a12^2*a21^2-g*a12*a21^2+g*a12^3*a21-\ n22*a12^2*a21+n11*a12^2*a21-g*a12*a21); ss3 := (4*p21*a22^3-p21*a12*a21*a22^2-4*p22*a21*a22^2+4*p11*a21*a22^2+7*p21*a12*a22^2-4*\ p11*p22*a22^2+4*p12*p21*a22^2+4*p11*a22^2+p22*a12*a21^2*a22-p11*a12*a21^2*a22-4*\ p12*a21^2*a22-p21*a12^2*a21*a22+5*p11*p22*a12*a21*a22-7*p22*a12*a21*a22-5*p12*p21*\ a12*a21*a22+2*p11*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p11*p22*a12*a22+3*p12*\ p21*a12*a22+3*p11*a12*a22+p12*a12*a21^3-p11*p22*a12^2*a21^2+p22*a12^2*a21^2+p12*\ p21*a12^2*a21^2-2*p12*a12*a21^2+3*p11*p22*a12^2*a21-3*p22*a12^2*a21-3*p12*p21*a12^2*\ a21-3*p12*a12*a21)/(3*p21*a12*a21*a22^2-3*p22*a21*a22^2+p21*a12*a22^2-p22*a22^2+\ 3*p11*a12*a21^2*a22-3*p12*a21^2*a22+5*p21*a12^2*a21*a22-5*p22*a12*a21*a22+4*p11*a12*\ a21*a22-4*p12*a21*a22+p21*a12^2*a22-p22*a12*a22+p11*a12*a22-p12*a22+2*p11*a12^2*\ a21^2-2*p12*a12*a21^2+2*p21*a12^3*a21-2*p22*a12^2*a21+2*p11*a12^2*a21-2*p12*a12*a21); ss4 := (4*p21*a12*a22^2-4*p22*a22^2+4*a22^2-p21*a12^2*a21*a22+p22*a12*a21*a22+4*p11*a12*\ a21*a22-5*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p22*a12*a22+3*a12*a22-p11*a12^2*\ a21^2+a12^2*a21^2+p12*a12*a21^2+3*p11*a12^2*a21-3*a12^2*a21-3*p12*a12*a21)/(2*p21*\ a12*a22^2-2*p22*a22^2+p21*a12^2*a21*a22-p22*a12*a21*a22+2*p11*a12*a21*a22-2*p12*\ a21*a22+2*p21*a12^2*a22-2*p22*a12*a22+2*p11*a12*a22-2*p12*a22+p11*a12^2*a21^2-p12*\ a12*a21^2+p21*a12^3*a21-p22*a12^2*a21+p11*a12^2*a21-p12*a12*a21); res1 := p11*p22*q1^2*q4^2-p12*p21*q1^2*q4^2-n22*p11*p22*q1*q4^2+2*n11*p11*p22*q1*q4^2-\ p11*p22*q1*q4^2+n22*p12*p21*q1*q4^2-2*n11*p12*p21*q1*q4^2+p12*p21*q1*q4^2+2*g^2*\ p11*p22*q4^2-2*n11*n22*p11*p22*q4^2+2*n22*p11*p22*q4^2+2*n11*p11*p22*q4^2-2*p11*p22*\ q4^2-2*g^2*p12*p21*q4^2+2*n11*n22*p12*p21*q4^2-2*n22*p12*p21*q4^2-2*n11*p12*p21*q4^2+\ 2*p12*p21*q4^2-n11*p22*q1*q2*q3*q4+g*p21*q1*q2*q3*q4+g*p12*q1*q2*q3*q4-n22*p11*\ q1*q2*q3*q4-g^2*p22*q2*q3*q4+n11*n22*p22*q2*q3*q4-n11*p22*q2*q3*q4-2*g*p21*q2*q3*\ q4+g*p12*q2*q3*q4+2*g^2*p11*q2*q3*q4-2*n11*n22*p11*q2*q3*q4+2*n22*p11*q2*q3*q4-n11*\ p22*q1*q3*q4+p22*q1*q3*q4+g*p21*q1*q3*q4-2*g*p12*q1*q3*q4+2*n22*p11*q1*q3*q4-2*p11*\ q1*q3*q4-g^2*p22*q3*q4+n11*n22*p22*q3*q4-n22*p22*q3*q4-n11*p22*q3*q4+p22*q3*q4-\ 4*g^2*p11*q3*q4+4*n11*n22*p11*q3*q4-4*n22*p11*q3*q4-4*n11*p11*q3*q4+4*p11*q3*q4+\ n22*p11*p22*q1*q2*q4-2*n11*p11*p22*q1*q2*q4+2*n11*p22*q1*q2*q4-n22*p12*p21*q1*q2*\ q4+2*n11*p12*p21*q1*q2*q4+g*p21*q1*q2*q4-2*g*p12*q1*q2*q4-n22*p11*q1*q2*q4-4*g^2*\ p11*p22*q2*q4+4*n11*n22*p11*p22*q2*q4-2*n22*p11*p22*q2*q4-2*n11*p11*p22*q2*q4+2*g^2*\ p22*q2*q4-2*n11*n22*p22*q2*q4+2*n11*p22*q2*q4+4*g^2*p12*p21*q2*q4-4*n11*n22*p12*p21*\ q2*q4+2*n22*p12*p21*q2*q4+2*n11*p12*p21*q2*q4-2*g*p21*q2*q4-2*g*p12*q2*q4+2*g^2*p11*\ q2*q4-2*n11*n22*p11*q2*q4+2*n22*p11*q2*q4-p11*p22*q1^2*q4-p22*q1^2*q4+p12*p21*q1^2*\ q4+2*p11*q1^2*q4-n22*p11*p22*q1*q4-4*n11*p11*p22*q1*q4+5*p11*p22*q1*q4+n22*p22*q1*\ q4-p22*q1*q4+n22*p12*p21*q1*q4+4*n11*p12*p21*q1*q4-5*p12*p21*q1*q4+g*p21*q1*q4+\ 4*g*p12*q1*q4+4*n11*p11*q1*q4-4*p11*q1*q4-g^2*q2^2*q3^2+n11*n22*q2^2*q3^2+g^2*\ q2*q3^2-n11*n22*q2*q3^2-n22*q2*q3^2+2*n11*q2*q3^2+2*g^2*q3^2-2*n11*n22*q3^2+2*n22*\ q3^2+2*n11*q3^2-2*q3^2+g^2*p22*q2^2*q3-n11*n22*p22*q2^2*q3-2*g^2*p11*q2^2*q3+2*n11*\ n22*p11*q2^2*q3+g^2*q2^2*q3-n11*n22*q2^2*q3+2*n11*p22*q1*q2*q3-2*g*p21*q1*q2*q3+\ g*p12*q1*q2*q3-n22*p11*q1*q2*q3+n22*q1*q2*q3-2*n11*q1*q2*q3+g^2*p22*q2*q3-n11*\ n22*p22*q2*q3+n22*p22*q2*q3+4*g*p21*q2*q3+g*p12*q2*q3+4*g^2*p11*q2*q3-4*n11*n22*\ p11*q2*q3+4*n11*p11*q2*q3-5*g^2*q2*q3+5*n11*n22*q2*q3-n22*q2*q3-4*n11*q2*q3+2*n11*\ p22*q1*q3-2*p22*q1*q3-2*g*p21*q1*q3-2*g*p12*q1*q3+2*n22*p11*q1*q3-2*p11*q1*q3-2*n22*\ q1*q3-2*n11*q1*q3+4*q1*q3+2*g^2*p11*p22*q2^2-2*n11*n22*p11*p22*q2^2-2*g^2*p22*q2^2+\ 2*n11*n22*p22*q2^2-2*g^2*p12*p21*q2^2+2*n11*n22*p12*p21*q2^2-2*g^2*p11*q2^2+2*n11*\ n22*p11*q2^2+2*g^2*q2^2-2*n11*n22*q2^2+n22*p11*p22*q1*q2+4*n11*p11*p22*q1*q2-n22*\ p22*q1*q2-4*n11*p22*q1*q2-n22*p12*p21*q1*q2-4*n11*p12*p21*q1*q2-n22*p11*q1*q2-4*\ n11*p11*q1*q2+n22*q1*q2+4*n11*q1*q2-2*p11*p22*q1^2+2*p22*q1^2+2*p12*p21*q1^2+2*p11*\ q1^2-2*q1^2; res := -l1*l2*p11*p22*q1^2*q4^2+l2*p11*p22*q1^2*q4^2+l1*p11*p22*q1^2*q4^2-p11*p22*q1^2*\ q4^2+l1*l2*p12*p21*q1^2*q4^2-l2*p12*p21*q1^2*q4^2-l1*p12*p21*q1^2*q4^2+p12*p21*\ q1^2*q4^2+l1*n22*p11*p22*q1*q4^2-n22*p11*p22*q1*q4^2+l2*n11*p11*p22*q1*q4^2-n11*\ p11*p22*q1*q4^2-l2*p11*p22*q1*q4^2-l1*p11*p22*q1*q4^2+2*p11*p22*q1*q4^2-l1*n22*\ p12*p21*q1*q4^2+n22*p12*p21*q1*q4^2-l2*n11*p12*p21*q1*q4^2+n11*p12*p21*q1*q4^2+\ l2*p12*p21*q1*q4^2+l1*p12*p21*q1*q4^2-2*p12*p21*q1*q4^2+g^2*p11*p22*q4^2-n11*n22*\ p11*p22*q4^2+n22*p11*p22*q4^2+n11*p11*p22*q4^2-p11*p22*q4^2-g^2*p12*p21*q4^2+\ n11*n22*p12*p21*q4^2-n22*p12*p21*q4^2-n11*p12*p21*q4^2+p12*p21*q4^2+l1*l2*n11*\ p22*q1*q2*q3*q4-l2*n11*p22*q1*q2*q3*q4-l1*n11*p22*q1*q2*q3*q4+n11*p22*q1*q2*q3*\ q4-l1*l2*g*p21*q1*q2*q3*q4+l2*g*p21*q1*q2*q3*q4+l1*g*p21*q1*q2*q3*q4-g*p21*q1*\ q2*q3*q4-l1*l2*g*p12*q1*q2*q3*q4+l2*g*p12*q1*q2*q3*q4+l1*g*p12*q1*q2*q3*q4-g*p12*\ q1*q2*q3*q4+l1*l2*n22*p11*q1*q2*q3*q4-l2*n22*p11*q1*q2*q3*q4-l1*n22*p11*q1*q2*q3*\ q4+n22*p11*q1*q2*q3*q4+l1*g^2*p22*q2*q3*q4-g^2*p22*q2*q3*q4-l1*n11*n22*p22*q2*\ q3*q4+n11*n22*p22*q2*q3*q4+l1*n11*p22*q2*q3*q4-n11*p22*q2*q3*q4-l2*g*p21*q2*q3*\ q4+g*p21*q2*q3*q4-l1*g*p12*q2*q3*q4+g*p12*q2*q3*q4+l2*g^2*p11*q2*q3*q4-g^2*p11*\ q2*q3*q4-l2*n11*n22*p11*q2*q3*q4+n11*n22*p11*q2*q3*q4+l2*n22*p11*q2*q3*q4-n22*\ p11*q2*q3*q4-l1*l2*n11*p22*q1*q3*q4+l1*n11*p22*q1*q3*q4+l1*l2*p22*q1*q3*q4-l1*\ p22*q1*q3*q4+l1*l2*g*p21*q1*q3*q4-l1*g*p21*q1*q3*q4+l1*l2*g*p12*q1*q3*q4-l2*g*\ p12*q1*q3*q4-l1*l2*n22*p11*q1*q3*q4+l2*n22*p11*q1*q3*q4+l1*l2*p11*q1*q3*q4-l2*\ p11*q1*q3*q4-l1*g^2*p22*q3*q4+l1*n11*n22*p22*q3*q4-l1*n22*p22*q3*q4-l1*n11*p22*\ q3*q4+l1*p22*q3*q4-l2*g^2*p11*q3*q4+l2*n11*n22*p11*q3*q4-l2*n22*p11*q3*q4-l2*\ n11*p11*q3*q4+l2*p11*q3*q4-l1*n22*p11*p22*q1*q2*q4+n22*p11*p22*q1*q2*q4-l2*n11*\ p11*p22*q1*q2*q4+n11*p11*p22*q1*q2*q4+l2*n11*p22*q1*q2*q4-n11*p22*q1*q2*q4+l1*\ n22*p12*p21*q1*q2*q4-n22*p12*p21*q1*q2*q4+l2*n11*p12*p21*q1*q2*q4-n11*p12*p21*q1*\ q2*q4-l1*g*p21*q1*q2*q4+g*p21*q1*q2*q4-l2*g*p12*q1*q2*q4+g*p12*q1*q2*q4+l1*n22*\ p11*q1*q2*q4-n22*p11*q1*q2*q4-2*g^2*p11*p22*q2*q4+2*n11*n22*p11*p22*q2*q4-n22*p11*\ p22*q2*q4-n11*p11*p22*q2*q4+g^2*p22*q2*q4-n11*n22*p22*q2*q4+n11*p22*q2*q4+2*g^2*\ p12*p21*q2*q4-2*n11*n22*p12*p21*q2*q4+n22*p12*p21*q2*q4+n11*p12*p21*q2*q4-g*p21*\ q2*q4-g*p12*q2*q4+g^2*p11*q2*q4-n11*n22*p11*q2*q4+n22*p11*q2*q4+2*l1*l2*p11*p22*\ q1^2*q4-l2*p11*p22*q1^2*q4-l1*p11*p22*q1^2*q4-l1*l2*p22*q1^2*q4+l1*p22*q1^2*q4-\ 2*l1*l2*p12*p21*q1^2*q4+l2*p12*p21*q1^2*q4+l1*p12*p21*q1^2*q4-l1*l2*p11*q1^2*q4+\ l2*p11*q1^2*q4-l1*n22*p11*p22*q1*q4-l2*n11*p11*p22*q1*q4+l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