
(/VERSIONCHECK 2) 

(DEFUN |INTAF;F2UPUP| (|f| |kx| |k| |p| $)
  (|INTAF;UP2UPUP| (SPADCALL |f| |k| |p| (QREFELT $ 11)) |kx| $)) 

(DEFUN |INTAF;rootintegrate| (|f| |t| |k| |derivation| $)
  (PROG (|p| |modulus| |r1| |f1| #0=#:G1827 |r| |q| |curve|)
    (RETURN
      (SEQ (LETT |r1|
                 (SPADCALL
                     (LETT |modulus|
                           (|INTAF;UP2UPUP|
                               (LETT |p| (SPADCALL |k| (QREFELT $ 14))
                                     . #1=(|INTAF;rootintegrate|))
                               |t| $) . #1#)
                     (QREFELT $ 18)) . #1#)
           (LETT |f1|
                 (SPADCALL (|INTAF;F2UPUP| |f| |t| |k| |p| $)
                     (SPADCALL (SPADCALL (QCAR |r1|) (QREFELT $ 20)) 1
                         (QREFELT $ 23))
                     (QREFELT $ 24)) . #1#)
           (LETT |r|
                 (PROG2 (LETT #0#
                              (SPADCALL (QCDR |r1|) (QREFELT $ 27)) . #1#)
                        (QCDR #0#)
                   (|check-union| (QEQCAR #0# 0)
                       (|Record|
                           (|:| |radicand|
                                (|Fraction|
                                    (|SparseUnivariatePolynomial|
                                     (QREFELT $ 7))))
                           (|:| |deg| (|NonNegativeInteger|)))
                       #0#)) . #1#)
           (LETT |q| (SPADCALL (QCAR |r|) (QREFELT $ 28)) . #1#)
           (LETT |curve|
                 (|RadicalFunctionField| (QREFELT $ 7)
                     (|SparseUnivariatePolynomial| (QREFELT $ 7))
                     (|SparseUnivariatePolynomial|
                         (|Fraction|
                             (|SparseUnivariatePolynomial|
                                 (QREFELT $ 7))))
                     (SPADCALL |q| (QREFELT $ 29)) (QCDR |r|)) . #1#)
           (EXIT (SPADCALL
                     (CONS #'|INTAF;rootintegrate!0|
                           (VECTOR |k| |t| |r1| |curve| $))
                     (SPADCALL
                         (SPADCALL |f1|
                             (|compiledLookupCheck| '|reduce|
                                 (LIST '$
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (LIST '|Fraction|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| (ELT $ 7))))))
                                 |curve|))
                         |derivation|
                         (|compiledLookupCheck| '|algintegrate|
                             (LIST (LIST '|IntegrationResult|
                                    (|devaluate| |curve|))
                                   (|devaluate| |curve|)
                                   (LIST '|Mapping|
                                    (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| (ELT $ 7)))
                                    (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| (ELT $ 7)))))
                             (|AlgebraicIntegrate| (ELT $ 6) (ELT $ 7)
                                 (|SparseUnivariatePolynomial|
                                     (ELT $ 7))
                                 (|SparseUnivariatePolynomial|
                                     (|Fraction|
                                      (|SparseUnivariatePolynomial|
                                       (ELT $ 7))))
                                 |curve|)))
                     (|compiledLookupCheck| '|map|
                         (LIST (LIST '|IntegrationResult|
                                     (|devaluate| (ELT $ 7)))
                               (LIST '|Mapping| (|devaluate| (ELT $ 7))
                                     (|devaluate| |curve|))
                               (LIST '|IntegrationResult|
                                     (|devaluate| |curve|)))
                         (|IntegrationResultFunctions2| |curve|
                             (ELT $ 7))))))))) 

(DEFUN |INTAF;rootintegrate!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 4) |INTAF;rootintegrate|)
    (RETURN
      (PROGN
        (|INTAF;UPUP2F|
            (SPADCALL |#1|
                (|compiledLookupCheck| '|lift|
                    (LIST (LIST '|SparseUnivariatePolynomial|
                                (LIST '|Fraction|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (|devaluate| (ELT $ 7)))))
                          '$)
                    (QREFELT $$ 3)))
            (QCAR (QREFELT $$ 2)) (QREFELT $$ 1) (QREFELT $$ 0) $))))) 

(DEFUN |INTAF;algintegrate| (|f| |t| |k| |derivation| $)
  (PROG (|r1| |f1| |p| |modulus| |curve|)
    (RETURN
      (SEQ (LETT |r1|
                 (SPADCALL
                     (LETT |modulus|
                           (|INTAF;UP2UPUP|
                               (LETT |p| (SPADCALL |k| (QREFELT $ 14))
                                     . #0=(|INTAF;algintegrate|))
                               |t| $) . #0#)
                     (QREFELT $ 18)) . #0#)
           (LETT |f1|
                 (SPADCALL (|INTAF;F2UPUP| |f| |t| |k| |p| $)
                     (SPADCALL (SPADCALL (QCAR |r1|) (QREFELT $ 20)) 1
                         (QREFELT $ 23))
                     (QREFELT $ 24)) . #0#)
           (LETT |modulus|
                 (|INTAF;UP2UPUP|
                     (LETT |p| (SPADCALL |k| (QREFELT $ 14)) . #0#) |t|
                     $) . #0#)
           (LETT |curve|
                 (|AlgebraicFunctionField| (QREFELT $ 7)
                     (|SparseUnivariatePolynomial| (QREFELT $ 7))
                     (|SparseUnivariatePolynomial|
                         (|Fraction|
                             (|SparseUnivariatePolynomial|
                                 (QREFELT $ 7))))
                     (QCDR |r1|)) . #0#)
           (EXIT (SPADCALL
                     (CONS #'|INTAF;algintegrate!0|
                           (VECTOR |k| |t| |r1| |curve| $))
                     (SPADCALL
                         (SPADCALL |f1|
                             (|compiledLookupCheck| '|reduce|
                                 (LIST '$
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (LIST '|Fraction|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| (ELT $ 7))))))
                                 |curve|))
                         |derivation|
                         (|compiledLookupCheck| '|algintegrate|
                             (LIST (LIST '|IntegrationResult|
                                    (|devaluate| |curve|))
                                   (|devaluate| |curve|)
                                   (LIST '|Mapping|
                                    (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| (ELT $ 7)))
                                    (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| (ELT $ 7)))))
                             (|AlgebraicIntegrate| (ELT $ 6) (ELT $ 7)
                                 (|SparseUnivariatePolynomial|
                                     (ELT $ 7))
                                 (|SparseUnivariatePolynomial|
                                     (|Fraction|
                                      (|SparseUnivariatePolynomial|
                                       (ELT $ 7))))
                                 |curve|)))
                     (|compiledLookupCheck| '|map|
                         (LIST (LIST '|IntegrationResult|
                                     (|devaluate| (ELT $ 7)))
                               (LIST '|Mapping| (|devaluate| (ELT $ 7))
                                     (|devaluate| |curve|))
                               (LIST '|IntegrationResult|
                                     (|devaluate| |curve|)))
                         (|IntegrationResultFunctions2| |curve|
                             (ELT $ 7))))))))) 

(DEFUN |INTAF;algintegrate!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 4) |INTAF;algintegrate|)
    (RETURN
      (PROGN
        (|INTAF;UPUP2F|
            (SPADCALL |#1|
                (|compiledLookupCheck| '|lift|
                    (LIST (LIST '|SparseUnivariatePolynomial|
                                (LIST '|Fraction|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (|devaluate| (ELT $ 7)))))
                          '$)
                    (QREFELT $$ 3)))
            (QCAR (QREFELT $$ 2)) (QREFELT $$ 1) (QREFELT $$ 0) $))))) 

(DEFUN |INTAF;UP2UPUP| (|p| |k| $)
  (SPADCALL (CONS #'|INTAF;UP2UPUP!0| (VECTOR $ |k|)) |p|
      (QREFELT $ 34))) 

(DEFUN |INTAF;UP2UPUP!0| (|#1| $$)
  (SPADCALL |#1| (QREFELT $$ 1) (QREFELT (QREFELT $$ 0) 31))) 

(DEFUN |INTAF;UPUP2F| (|p| |cf| |t| |k| $)
  (SPADCALL
      (SPADCALL (CONS #'|INTAF;UPUP2F!0| (VECTOR $ |t|)) |p|
          (QREFELT $ 38))
      (SPADCALL (SPADCALL |cf| |t| (QREFELT $ 35))
          (SPADCALL |k| (QREFELT $ 39)) (QREFELT $ 40))
      (QREFELT $ 41))) 

(DEFUN |INTAF;UPUP2F!0| (|#1| $$)
  (SPADCALL |#1| (QREFELT $$ 1) (QREFELT (QREFELT $$ 0) 35))) 

(DEFUN |INTAF;algint;F2KMIr;6| (|f| |t| |y| |derivation| $)
  (COND
    ((SPADCALL |y| (SPADCALL "nthRoot" (QREFELT $ 44)) (QREFELT $ 46))
     (|INTAF;rootintegrate| |f| |t| |y| |derivation| $))
    ((SPADCALL |y| (SPADCALL "rootOf" (QREFELT $ 44)) (QREFELT $ 46))
     (|INTAF;algintegrate| |f| |t| |y| |derivation| $))
    ('T (|error| "failed - cannot handle that integrand")))) 

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

(DEFUN |AlgebraicIntegration;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|AlgebraicIntegration|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|AlgebraicIntegration| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 50) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|AlgebraicIntegration|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        $)))) 

(MAKEPROP '|AlgebraicIntegration| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|SparseUnivariatePolynomial| 7) (|Kernel| 7)
             (|PolynomialCategoryQuotientFunctions|
                 (|IndexedExponents| 9) 9 6
                 (|SparseMultivariatePolynomial| 6 9) 7)
             (0 . |univariate|) (|SparseUnivariatePolynomial| $)
             (|Kernel| $) (7 . |minPoly|)
             (|Record| (|:| |coef| 19) (|:| |poly| 16))
             (|SparseUnivariatePolynomial| 19)
             (|ChangeOfVariable| 7 8 16) (12 . |mkIntegral|)
             (|Fraction| 8) (17 . |inv|) (22 . |One|)
             (|NonNegativeInteger|) (26 . |monomial|) (32 . |elt|)
             (|Record| (|:| |radicand| 19) (|:| |deg| 22))
             (|Union| 25 '"failed") (38 . |radPoly|) (43 . |retract|)
             (48 . |coerce|) (|Fraction| 12) (53 . |univariate|)
             (|Mapping| 19 7)
             (|SparseUnivariatePolynomialFunctions2| 7 19) (59 . |map|)
             (65 . |multivariate|) (|Mapping| 7 19)
             (|SparseUnivariatePolynomialFunctions2| 19 7) (71 . |map|)
             (77 . |coerce|) (82 . *) (88 . |elt|) (|String|)
             (|Symbol|) (94 . |coerce|) (|Boolean|) (99 . |is?|)
             (|IntegrationResult| 7) (|Mapping| 8 8)
             |INTAF;algint;F2KMIr;6|)
          '#(|algint| 105) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 49
                                '(3 10 8 7 9 8 11 1 7 12 13 14 1 17 15
                                  16 18 1 19 0 0 20 0 6 0 21 2 16 0 19
                                  22 23 2 16 0 0 0 24 1 17 26 16 27 1
                                  19 8 0 28 1 19 0 8 29 2 7 30 0 13 31
                                  2 33 16 32 8 34 2 10 7 19 9 35 2 37 8
                                  36 16 38 1 7 0 13 39 2 7 0 0 0 40 2 8
                                  7 0 7 41 1 43 0 42 44 2 9 45 0 43 46
                                  4 0 47 7 9 9 48 49)))))
          '|lookupComplete|)) 
