
(/VERSIONCHECK 2) 

(DEFUN |POLUTIL;sturmSequence;ThePolsL;1| (|p| $)
  (SPADCALL |p| (SPADCALL |p| (QREFELT $ 8)) (QREFELT $ 10))) 

(DEFUN |POLUTIL;sylvesterSequence;2ThePolsL;2| (|p1| |p2| $)
  (PROG (|res| #1=#:G1819 |term| #2=#:G1818 |#G8| |#G7|)
    (RETURN
     (SEQ
      (LETT |res| (LIST |p1|) . #3=(|POLUTIL;sylvesterSequence;2ThePolsL;2|))
      (SEQ G190
           (COND
            ((NULL
              (COND ((SPADCALL |p2| (|spadConstant| $ 13) (QREFELT $ 15)) 'NIL)
                    ('T 'T)))
             #4=(GO G191)))
           (SEQ (LETT |res| (CONS |p2| |res|) . #3#)
                (EXIT
                 (PROGN
                  (LETT |#G7| |p2| . #3#)
                  (LETT |#G8|
                        (SPADCALL (SPADCALL |p1| |p2| (QREFELT $ 16))
                                  (QREFELT $ 17))
                        . #3#)
                  (LETT |p1| |#G7| . #3#)
                  (LETT |p2| |#G8| . #3#))))
           NIL #5=(GO G190) G191 (EXIT NIL))
      (COND
       ((< 0 (SPADCALL |p1| (QREFELT $ 19)))
        (SEQ (LETT |p1| (SPADCALL |p1| (QREFELT $ 20)) . #3#)
             (EXIT
              (LETT |res|
                    (PROGN
                     (LETT #2# NIL . #3#)
                     (SEQ (LETT |term| NIL . #3#) (LETT #1# |res| . #3#) G190
                          (COND
                           ((OR (ATOM #1#)
                                (PROGN (LETT |term| (CAR #1#) . #3#) NIL))
                            #4#))
                          (SEQ
                           (EXIT
                            (LETT #2#
                                  (CONS (SPADCALL |term| |p1| (QREFELT $ 21))
                                        #2#)
                                  . #3#)))
                          (LETT #1# (CDR #1#) . #3#) #5# G191
                          (EXIT (NREVERSE0 #2#))))
                    . #3#)))))
      (EXIT (NREVERSE |res|)))))) 

(DEFUN |POLUTIL;boundOfCauchy;ThePolsTheField;3| (|p| $)
  (PROG (#1=#:G1822 #2=#:G1821 #3=#:G1823 #4=#:G1828 |t| |l| #5=#:G1827 |term|
         #6=#:G1826 |c|)
    (RETURN
     (SEQ
      (LETT |c| (SPADCALL (SPADCALL |p| (QREFELT $ 22)) (QREFELT $ 23))
            . #7=(|POLUTIL;boundOfCauchy;ThePolsTheField;3|))
      (LETT |l|
            (PROGN
             (LETT #6# NIL . #7#)
             (SEQ (LETT |term| NIL . #7#)
                  (LETT #5# (CDR (SPADCALL |p| (QREFELT $ 25))) . #7#) G190
                  (COND
                   ((OR (ATOM #5#) (PROGN (LETT |term| (CAR #5#) . #7#) NIL))
                    #8=(GO G191)))
                  (SEQ
                   (EXIT
                    (LETT #6# (CONS (SPADCALL |c| |term| (QREFELT $ 26)) #6#)
                          . #7#)))
                  (LETT #5# (CDR #5#) . #7#) #9=(GO G190) G191
                  (EXIT (NREVERSE0 #6#))))
            . #7#)
      (EXIT
       (COND ((NULL |l|) (|spadConstant| $ 27))
             (#10='T
              (SPADCALL (|spadConstant| $ 27)
                        (PROGN
                         (LETT #1# NIL . #7#)
                         (SEQ (LETT |t| NIL . #7#) (LETT #4# |l| . #7#) G190
                              (COND
                               ((OR (ATOM #4#)
                                    (PROGN (LETT |t| (CAR #4#) . #7#) NIL))
                                #8#))
                              (SEQ
                               (EXIT
                                (PROGN
                                 (LETT #3# (SPADCALL |t| (QREFELT $ 29)) . #7#)
                                 (COND
                                  (#1#
                                   (LETT #2# (SPADCALL #2# #3# (QREFELT $ 30))
                                         . #7#))
                                  ('T
                                   (PROGN
                                    (LETT #2# #3# . #7#)
                                    (LETT #1# 'T . #7#)))))))
                              (LETT #4# (CDR #4#) . #7#) #9# G191 (EXIT NIL))
                         (COND (#1# #2#) (#10# (|IdentityError| '|max|))))
                        (QREFELT $ 31))))))))) 

(DEFUN |POLUTIL;sturmVariationsOf;LNni;4| (|l| $)
  (PROG (|ll| |ln| #1=#:G1834 |term| |l1|)
    (RETURN
     (SEQ
      (COND ((NULL |l|) (|error| "POLUTIL: sturmVariationsOf: empty list !"))
            (#2='T
             (SEQ
              (LETT |l1| (|SPADfirst| |l|)
                    . #3=(|POLUTIL;sturmVariationsOf;LNni;4|))
              (LETT |ll| NIL . #3#)
              (SEQ (LETT |term| NIL . #3#) (LETT #1# (CDR |l|) . #3#) G190
                   (COND
                    ((OR (ATOM #1#) (PROGN (LETT |term| (CAR #1#) . #3#) NIL))
                     (GO G191)))
                   (SEQ
                    (EXIT
                     (COND
                      ((NULL (SPADCALL |term| (QREFELT $ 33)))
                       (LETT |ll| (CONS |term| |ll|) . #3#)))))
                   (LETT #1# (CDR #1#) . #3#) (GO G190) G191 (EXIT NIL))
              (EXIT
               (COND
                ((NULL |ll|)
                 (|error| "POLUTIL: sturmVariationsOf: Bad sequence"))
                (#2#
                 (SEQ (LETT |ln| (|SPADfirst| |ll|) . #3#)
                      (LETT |ll| (REVERSE (CDR |ll|)) . #3#)
                      (EXIT
                       (COND
                        ((SPADCALL |l1| (QREFELT $ 33))
                         (+ 1
                            (SPADCALL (CDR |ll|)
                                      (SPADCALL (|SPADfirst| |ll|)
                                                (QREFELT $ 35))
                                      (SPADCALL |ln| (QREFELT $ 35))
                                      (QREFELT $ 36))))
                        (#2#
                         (SPADCALL |ll| (SPADCALL |l1| (QREFELT $ 35))
                                   (SPADCALL |ln| (QREFELT $ 35))
                                   (QREFELT $ 36)))))))))))))))) 

(DEFUN |POLUTIL;lazyVariations;L2INni;5| (|l| |sl| |sh| $)
  (PROG (|s|)
    (RETURN
     (SEQ
      (COND
       ((OR (ZEROP |sl|) (ZEROP |sh|))
        (|error| "POLUTIL: lazyVariations: zero sign!"))
       ('T
        (COND ((NULL |l|) (COND ((EQL |sl| |sh|) 0) (#1='T 1)))
              ((NULL (CDR |l|))
               (COND
                ((SPADCALL (|SPADfirst| |l|) (QREFELT $ 33))
                 (|error| "POLUTIL: lazyVariations: zero sign!"))
                ((EQL |sl| |sh|)
                 (COND
                  ((EQL |sl| (SPADCALL (|SPADfirst| |l|) (QREFELT $ 35))) 0)
                  (#1# 2)))
                (#1# 1)))
              (#1#
               (SEQ
                (LETT |s|
                      (SPADCALL (SPADCALL |l| 2 (QREFELT $ 38)) (QREFELT $ 35))
                      |POLUTIL;lazyVariations;L2INni;5|)
                (EXIT
                 (+ (SPADCALL (LIST (|SPADfirst| |l|)) |sl| |s| (QREFELT $ 36))
                    (SPADCALL (CDR (CDR |l|)) |s| |sh|
                              (QREFELT $ 36))))))))))))) 

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

(DEFUN |RealPolynomialUtilitiesPackage;| (|#1| |#2|)
  (PROG (|pv$| $ |dv$| DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|RealPolynomialUtilitiesPackage|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT |dv$| (LIST '|RealPolynomialUtilitiesPackage| DV$1 DV$2) . #1#)
      (LETT $ (GETREFV 39) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#1|
                                                         '(|OrderedRing|))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|RealPolynomialUtilitiesPackage|
                  (LIST DV$1 DV$2) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (COND
       ((|testBitVector| |pv$| 1)
        (PROGN
         (QSETREFV $ 32
                   (CONS
                    (|dispatchFunction|
                     |POLUTIL;boundOfCauchy;ThePolsTheField;3|)
                    $))
         (QSETREFV $ 37
                   (CONS
                    (|dispatchFunction| |POLUTIL;sturmVariationsOf;LNni;4|) $))
         (QSETREFV $ 36
                   (CONS (|dispatchFunction| |POLUTIL;lazyVariations;L2INni;5|)
                         $)))))
      $)))) 

(MAKEPROP '|RealPolynomialUtilitiesPackage| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (0 . |differentiate|) (|List| 7)
              |POLUTIL;sylvesterSequence;2ThePolsL;2|
              |POLUTIL;sturmSequence;ThePolsL;1| (5 . |Zero|) (9 . |Zero|)
              (|Boolean|) (13 . =) (19 . |rem|) (25 . -) (|NonNegativeInteger|)
              (30 . |degree|) (35 . |unitCanonical|) (40 . |quo|)
              (46 . |leadingCoefficient|) (51 . |inv|) (|List| 6)
              (56 . |coefficients|) (61 . *) (67 . |One|) (71 . |One|)
              (75 . |abs|) (80 . |max|) (86 . +) (92 . |boundOfCauchy|)
              (97 . |zero?|) (|Integer|) (102 . |sign|)
              (107 . |lazyVariations|) (114 . |sturmVariationsOf|)
              (119 . |elt|))
           '#(|sylvesterSequence| 125 |sturmVariationsOf| 131 |sturmSequence|
              136 |lazyVariations| 141 |boundOfCauchy| 148)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 38
                                                 '(1 7 0 0 8 0 6 0 12 0 7 0 13
                                                   2 7 14 0 0 15 2 7 0 0 0 16 1
                                                   7 0 0 17 1 7 18 0 19 1 7 0 0
                                                   20 2 7 0 0 0 21 1 7 6 0 22 1
                                                   6 0 0 23 1 7 24 0 25 2 6 0 0
                                                   0 26 0 6 0 27 0 7 0 28 1 6 0
                                                   0 29 2 6 0 0 0 30 2 6 0 0 0
                                                   31 1 0 6 7 32 1 6 14 0 33 1
                                                   6 34 0 35 3 0 18 24 34 34 36
                                                   1 0 18 24 37 2 24 6 0 34 38
                                                   2 0 9 7 7 10 1 1 18 24 37 1
                                                   0 9 7 11 3 1 18 24 34 34 36
                                                   1 1 6 7 32)))))
           '|lookupComplete|)) 
