
(/VERSIONCHECK 2) 

(DEFUN |IALGFACT;perturbfactor| (|f| |k| |fact| $)
  (PROG (|newf| |lsols| |pol| #0=#:G1823 |pp| #1=#:G1824)
    (RETURN
      (SEQ (LETT |pol|
                 (SPADCALL
                     (SPADCALL (|spadConstant| $ 10) 1 (QREFELT $ 14))
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL (SPADCALL |k| (QREFELT $ 16)) 1
                                 (QREFELT $ 17))
                             (QREFELT $ 18))
                         0 (QREFELT $ 14))
                     (QREFELT $ 19))
                 . #2=(|IALGFACT;perturbfactor|))
           (LETT |newf| (SPADCALL |f| |pol| (QREFELT $ 20)) . #2#)
           (LETT |lsols|
                 (|IALGFACT;irrfactor| |newf| |k| |fact| $) . #2#)
           (LETT |pol|
                 (SPADCALL
                     (SPADCALL (|spadConstant| $ 10) 1 (QREFELT $ 14))
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL (SPADCALL |k| (QREFELT $ 16)) 1
                                 (QREFELT $ 17))
                             (QREFELT $ 18))
                         0 (QREFELT $ 14))
                     (QREFELT $ 21)) . #2#)
           (EXIT (PROGN
                   (LETT #0# NIL . #2#)
                   (SEQ (LETT |pp| NIL . #2#) (LETT #1# |lsols| . #2#)
                        G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |pp| (CAR #1#) . #2#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS
                                     (SPADCALL |pp| |pol|
                                      (QREFELT $ 20))
                                     #0#) . #2#)))
                        (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#))))))))) 

(DEFUN |IALGFACT;irrfactor| (|f| |k| |fact| $)
  (PROG (|nn| |listfact| |pelt| #0=#:G1843 |g| #1=#:G1834 |newf|
              |listerm|)
    (RETURN
      (SEQ (COND
             ((EQL (SPADCALL |f| (QREFELT $ 22)) 1) (LIST |f|))
             ('T
              (SEQ (LETT |newf| |f| . #2=(|IALGFACT;irrfactor|))
                   (LETT |nn| (|IALGFACT;pnorm| |f| $) . #2#)
                   (LETT |listfact|
                         (SPADCALL (SPADCALL |nn| |fact|)
                             (QREFELT $ 26)) . #2#)
                   (EXIT (COND
                           ((EQL (LENGTH |listfact|) 1)
                            (COND
                              ((EQL (QCDR (|SPADfirst| |listfact|)) 1)
                               (LIST |f|))
                              ('T
                               (|IALGFACT;perturbfactor| |f| (+ |k| 1)
                                   |fact| $))))
                           ('T
                            (SEQ (LETT |listerm| NIL . #2#)
                                 (SEQ (LETT |pelt| NIL . #2#)
                                      (LETT #0# |listfact| . #2#) G190
                                      (COND
                                        ((OR (ATOM #0#)
                                          (PROGN
                                            (LETT |pelt|
                                             (CAR #0#) . #2#)
                                            NIL))
                                         (GO G191)))
                                      (SEQ
                                       (LETT |g|
                                        (SPADCALL
                                         (|IALGFACT;change|
                                          (QCAR |pelt|) $)
                                         |newf| (QREFELT $ 27)) . #2#)
                                       (LETT |newf|
                                        (PROG2
                                         (LETT #1#
                                          (SPADCALL |newf| |g|
                                           (QREFELT $ 29)) . #2#)
                                         (QCDR #1#)
                                          (|check-union| (QEQCAR #1# 0)
                                           (QREFELT $ 9) #1#)) . #2#)
                                       (EXIT
                                        (LETT |listerm|
                                         (COND
                                           ((EQL (QCDR |pelt|) 1)
                                            (CONS |g| |listerm|))
                                           ('T
                                            (APPEND
                                             (|IALGFACT;perturbfactor|
                                              |g| (+ |k| 1) |fact| $)
                                             |listerm|))) . #2#)))
                                      (LETT #0# (CDR #0#) . #2#)
                                      (GO G190) G191 (EXIT NIL))
                                 (EXIT |listerm|)))))))))))) 

(DEFUN |IALGFACT;factor;AlPolMF;3| (|f| |fact| $)
  (PROG (|sqf| |sqterm| #0=#:G1856 |pol| #1=#:G1857 #2=#:G1852
               #3=#:G1850 #4=#:G1851 #5=#:G1849 #6=#:G1847 #7=#:G1848)
    (RETURN
      (SEQ (LETT |sqf| (SPADCALL |f| (QREFELT $ 31))
                 . #8=(|IALGFACT;factor;AlPolMF;3|))
           (EXIT (SPADCALL (SPADCALL |sqf| (QREFELT $ 33))
                     (PROGN
                       (LETT #7# NIL . #8#)
                       (SEQ (LETT |sqterm| NIL . #8#)
                            (LETT #0#
                                  (SPADCALL |sqf| (QREFELT $ 36)) . #8#)
                            G190
                            (COND
                              ((OR (ATOM #0#)
                                   (PROGN
                                     (LETT |sqterm| (CAR #0#) . #8#)
                                     NIL))
                               #9=(GO G191)))
                            (SEQ (EXIT (PROGN
                                         (LETT #5#
                                          (PROGN
                                            (LETT #4# NIL . #8#)
                                            (SEQ (LETT |pol| NIL . #8#)
                                             (LETT #1#
                                              (|IALGFACT;irrfactor|
                                               (QCAR |sqterm|) 0 |fact|
                                               $) . #8#)
                                             G190
                                             (COND
                                               ((OR (ATOM #1#)
                                                 (PROGN
                                                   (LETT |pol|
                                                    (CAR #1#) . #8#)
                                                   NIL))
                                                #9#))
                                             (SEQ
                                              (EXIT
                                               (PROGN
                                                 (LETT #2#
                                                  (SPADCALL |pol|
                                                   (QCDR |sqterm|)
                                                   (QREFELT $ 37)) . #8#)
                                                 (COND
                                                   (#4#
                                                    (LETT #3#
                                                     (SPADCALL #3# #2#
                                                      (QREFELT $ 38)) . #8#))
                                                   ('T
                                                    (PROGN
                                                      (LETT #3#
                                                       #2# . #8#)
                                                      (LETT #4#
                                                       'T . #8#)))))))
                                             (LETT #1# (CDR #1#) . #8#)
                                             #10=(GO G190) G191
                                             (EXIT NIL))
                                            (COND
                                              (#4# #3#)
                                              ('T
                                               (|spadConstant| $ 39)))) . #8#)
                                         (COND
                                           (#7#
                                            (LETT #6#
                                             (SPADCALL #6# #5#
                                              (QREFELT $ 38)) . #8#))
                                           ('T
                                            (PROGN
                                              (LETT #6# #5# . #8#)
                                              (LETT #7# 'T . #8#)))))))
                            (LETT #0# (CDR #0#) . #8#) #10# G191
                            (EXIT NIL))
                       (COND (#7# #6#) ('T (|spadConstant| $ 39))))
                     (QREFELT $ 40))))))) 

(DEFUN |IALGFACT;pnorm| (|q| $)
  (SPADCALL (|IALGFACT;convrt| |q| $) (QREFELT $ 50) (QREFELT $ 51))) 

(DEFUN |IALGFACT;change| (|q| $)
  (SPADCALL (ELT $ 52) |q| (QREFELT $ 55))) 

(DEFUN |IALGFACT;convrt| (|q| $)
  (SPADCALL (SPADCALL (ELT $ 56) |q| (QREFELT $ 59)) (QREFELT $ 61))) 

(DEFUN |InnerAlgFactor| (&REST #0=#:G1864)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1865)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (|devaluateList| #0#)
                       (HGET |$ConstructorCache| '|InnerAlgFactor|)
                       '|domainEqualList|)
                   . #2=(|InnerAlgFactor|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (APPLY (|function| |InnerAlgFactor;|) #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache| '|InnerAlgFactor|))))))))))) 

(DEFUN |InnerAlgFactor;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|InnerAlgFactor|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$| (LIST '|InnerAlgFactor| DV$1 DV$2 DV$3 DV$4) . #0#)
        (LETT $ (GETREFV 62) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|InnerAlgFactor|
            (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        (QSETREFV $ 44 (SPADCALL (QREFELT $ 43)))
        (QSETREFV $ 50
            (SPADCALL (CONS #'|InnerAlgFactor!0| $) (QREFELT $ 44)
                (QREFELT $ 49)))
        $)))) 

(DEFUN |InnerAlgFactor!0| (|#1| $) (SPADCALL |#1| (QREFELT $ 45))) 

(MAKEPROP '|InnerAlgFactor| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (0 . |One|) (4 . |One|)
             (8 . |One|) (|NonNegativeInteger|) (12 . |monomial|)
             (|Integer|) (18 . |coerce|) (23 . |monomial|)
             (29 . |reduce|) (34 . -) (40 . |elt|) (46 . +)
             (52 . |degree|)
             (|Record| (|:| |factor| 7) (|:| |exponent| 15))
             (|List| 23) (|Factored| 7) (57 . |factors|) (62 . |gcd|)
             (|Union| $ '"failed") (68 . |exquo|) (|Factored| $)
             (74 . |squareFree|) (|Factored| 9) (79 . |unit|)
             (|Record| (|:| |factor| 9) (|:| |exponent| 15))
             (|List| 34) (84 . |factors|) (89 . |primeFactor|) (95 . *)
             (101 . |One|) (105 . *) (|Mapping| 25 7)
             |IALGFACT;factor;AlPolMF;3| (111 . |definingPolynomial|)
             '|p| (115 . |coerce|) (|SparseUnivariatePolynomial| 7)
             (|Mapping| 7 6)
             (|UnivariatePolynomialCategoryFunctions2| 6 7 7 46)
             (120 . |map|) '|newp| (126 . |resultant|) (132 . |coerce|)
             (|Mapping| 8 6)
             (|UnivariatePolynomialCategoryFunctions2| 6 7 8 9)
             (137 . |map|) (143 . |lift|) (|Mapping| 7 8)
             (|UnivariatePolynomialCategoryFunctions2| 8 9 7 46)
             (148 . |map|)
             (|CommuteUnivariatePolynomialCategory| 6 7 46)
             (154 . |swap|))
          '#(|factor| 159) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 61
                                '(0 8 0 10 0 6 0 11 0 7 0 12 2 9 0 8 13
                                  14 1 6 0 15 16 2 7 0 6 13 17 1 8 0 7
                                  18 2 9 0 0 0 19 2 9 0 0 0 20 2 9 0 0
                                  0 21 1 9 13 0 22 1 25 24 0 26 2 9 0 0
                                  0 27 2 9 28 0 0 29 1 9 30 0 31 1 32 9
                                  0 33 1 32 35 0 36 2 32 0 9 15 37 2 32
                                  0 0 0 38 0 32 0 39 2 32 0 9 0 40 0 8
                                  7 43 1 7 0 6 45 2 48 46 47 7 49 2 46
                                  7 0 0 51 1 8 0 6 52 2 54 9 53 7 55 1
                                  8 7 0 56 2 58 46 57 9 59 1 60 46 46
                                  61 2 0 32 9 41 42)))))
          '|lookupComplete|)) 
