Index: factory/facAbsBiFact.cc
===================================================================
--- factory/facAbsBiFact.cc	(revision f36755e8e4a754eb8a49487d0e998ed26a2b2c78)
+++ factory/facAbsBiFact.cc	(revision 44cd9a84967624b3cb752fb6646f1824acd60ae1)
@@ -36,37 +36,39 @@
 TIMING_DEFINE_PRINT(fac_evalpoint)
 
-CFAFList uniAbsFactorize (const CanonicalForm& F)
+CFAFList uniAbsFactorize (const CanonicalForm& F, bool full)
 {
-  CFFList rationalFactors= factorize (F);
-  CFFListIterator i= rationalFactors;
-  CanonicalForm LcF= rationalFactors.getFirst().factor();
-  i++;
+  CFAFList result;
+  if (degree (F) == 1)
+  {
+    bool isRat= isOn (SW_RATIONAL);
+    On (SW_RATIONAL);
+    result= CFAFList (CFAFactor (F/Lc(F), 1, 1));
+    result.insert (CFAFactor (Lc (F), 1, 1));
+    if (!isRat)
+      Off (SW_RATIONAL);
+    return result;
+  }
+  CanonicalForm LcF= 1;
   Variable alpha;
-  CFAFList result;
   CFFList QaFactors;
   CFFListIterator iter;
-  for (; i.hasItem(); i++)
-  {
-    if (degree (i.getItem().factor()) == 1)
-    {
-      result.append (CFAFactor (i.getItem().factor(), 1, i.getItem().exp()));
-      continue;
-    }
-    alpha= rootOf (i.getItem().factor());
-    QaFactors= factorize (i.getItem().factor(), alpha);
-    iter= QaFactors;
-    if (iter.getItem().factor().inCoeffDomain())
-    {
-      LcF *= iter.getItem().factor();
-      iter++;
-    }
-    for (;iter.hasItem(); iter++)
-    {
-      if (degree (iter.getItem().factor()) == 1)
-      {
-        result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha),
-                                  i.getItem().exp()));
-        break;
-      }
+  alpha= rootOf (F);
+  QaFactors= factorize (F, alpha);
+  iter= QaFactors;
+  if (iter.getItem().factor().inCoeffDomain())
+  {
+    LcF = iter.getItem().factor();
+    iter++;
+  }
+  for (;iter.hasItem(); iter++)
+  {
+    if (full)
+      result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha),
+                                iter.getItem().exp()));
+    if (!full && degree (iter.getItem().factor()) == 1)
+    {
+      result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha),
+                                iter.getItem().exp()));
+      break;
     }
   }
@@ -271,4 +273,69 @@
   F /= icontent (F);
   On (SW_RATIONAL);
+
+  mpz_t * M=new mpz_t [4];
+  mpz_init (M[0]);
+  mpz_init (M[1]);
+  mpz_init (M[2]);
+  mpz_init (M[3]);
+
+  mpz_t * S=new mpz_t [2];
+  mpz_init (S[0]);
+  mpz_init (S[1]);
+
+  F= compress (F, M, S);
+
+  if (F.isUnivariate())
+  {
+    if (degree (F) == 1)
+    {
+      mpz_clear (M[0]);
+      mpz_clear (M[1]);
+      mpz_clear (M[2]);
+      mpz_clear (M[3]);
+      delete [] M;
+
+      mpz_clear (S[0]);
+      mpz_clear (S[1]);
+      delete [] S;
+      if (!isRat)
+        Off (SW_RATIONAL);
+      return CFAFList (CFAFactor (G, 1, 1));
+    }
+    CFAFList result= uniAbsFactorize (F, full);
+    if (result.getFirst().factor().inCoeffDomain())
+      result.removeFirst();
+    for (CFAFListIterator iter=result; iter.hasItem(); iter++)
+      iter.getItem()= CFAFactor (decompress (iter.getItem().factor(), M, S),
+                                 iter.getItem().minpoly(),iter.getItem().exp());
+    mpz_clear (M[0]);
+    mpz_clear (M[1]);
+    mpz_clear (M[2]);
+    mpz_clear (M[3]);
+    delete [] M;
+
+    mpz_clear (S[0]);
+    mpz_clear (S[1]);
+    delete [] S;
+    if (!isRat)
+      Off (SW_RATIONAL);
+    return result;
+  }
+
+  if (degree (F, 1) == 1 || degree (F, 2) == 1)
+  {
+    mpz_clear (M[0]);
+    mpz_clear (M[1]);
+    mpz_clear (M[2]);
+    mpz_clear (M[3]);
+    delete [] M;
+
+    mpz_clear (S[0]);
+    mpz_clear (S[1]);
+    delete [] S;
+    if (!isRat)
+      Off (SW_RATIONAL);
+    return CFAFList (CFAFactor (G, 1, 1));
+  }
   int minTdeg, tdegF= totaldegree (F);
   CanonicalForm Fp, smallestFactor;
@@ -305,4 +372,13 @@
           On (SW_RATIONAL);
         setCharacteristic(0);
+        mpz_clear (M[0]);
+        mpz_clear (M[1]);
+        mpz_clear (M[2]);
+        mpz_clear (M[3]);
+        delete [] M;
+
+        mpz_clear (S[0]);
+        mpz_clear (S[1]);
+        delete [] S;
         return CFAFList (CFAFactor (G, 1, 1));
       }
@@ -314,4 +390,13 @@
           if (isRat)
             On (SW_RATIONAL);
+          mpz_clear (M[0]);
+          mpz_clear (M[1]);
+          mpz_clear (M[2]);
+          mpz_clear (M[3]);
+          delete [] M;
+
+          mpz_clear (S[0]);
+          mpz_clear (S[1]);
+          delete [] S;
           return CFAFList (CFAFactor (G, 1, 1));
         }
@@ -729,10 +814,12 @@
   {
     if (full)
-      result.append (CFAFactor (i.getItem(), getMipo (alpha), 1));
+      result.append (CFAFactor (decompress (i.getItem(), M, S),
+                                getMipo (alpha), 1));
 
     if (totaldegree (i.getItem()) == minTdeg)
     {
       if (!full)
-        result= CFAFList (CFAFactor (i.getItem(), getMipo (alpha), 1));
+        result= CFAFList (CFAFactor (decompress (i.getItem(), M, S),
+                                     getMipo (alpha), 1));
       found= true;
 
@@ -754,4 +841,14 @@
     Off (SW_RATIONAL);
 
+  mpz_clear (M[0]);
+  mpz_clear (M[1]);
+  mpz_clear (M[2]);
+  mpz_clear (M[3]);
+  delete [] M;
+
+  mpz_clear (S[0]);
+  mpz_clear (S[1]);
+  delete [] S;
+
   return result;
 }
