
(/VERSIONCHECK 2) 

(DEFUN |FS2EXPXP;ratIfCan| (|fcn| $) (SPADCALL |fcn| (QREFELT $ 16))) 

(DEFUN |FS2EXPXP;stateSeriesProblem| (|function| |problem| $)
  (CONS 1 (CONS |function| |problem|))) 

(DEFUN |FS2EXPXP;stateProblem| (|function| |problem| $)
  (CONS 1 (CONS |function| |problem|))) 

(DEFUN |FS2EXPXP;newElem| (|f| $)
  (SPADCALL (|FS2EXPXP;smpElem| (SPADCALL |f| (QREFELT $ 18)) $)
            (|FS2EXPXP;smpElem| (SPADCALL |f| (QREFELT $ 19)) $)
            (QREFELT $ 20))) 

(DEFUN |FS2EXPXP;smpElem| (|p| $)
  (SPADCALL (CONS (|function| |FS2EXPXP;k2Elem|) $) (ELT $ 21) |p|
            (QREFELT $ 26))) 

(DEFUN |FS2EXPXP;k2Elem| (|k| $)
  (PROG (|cosz| |sinz| |iez| |ez| |z| |args| #1=#:G759 |a| #2=#:G758)
    (RETURN
     (SEQ
      (LETT |args|
            (PROGN
             (LETT #2# NIL . #3=(|FS2EXPXP;k2Elem|))
             (SEQ (LETT |a| NIL . #3#)
                  (LETT #1# (SPADCALL |k| (QREFELT $ 29)) . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |a| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT
                    (LETT #2# (CONS (|FS2EXPXP;newElem| |a| $) #2#) . #3#)))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT
       (COND ((NULL |args|) (SPADCALL |k| (QREFELT $ 31)))
             (#4='T
              (SEQ
               (LETT |iez|
                     (SPADCALL
                      (LETT |ez|
                            (SPADCALL (LETT |z| (|SPADfirst| |args|) . #3#)
                                      (QREFELT $ 32))
                            . #3#)
                      (QREFELT $ 33))
                     . #3#)
               (LETT |sinz| (SPADCALL |z| (QREFELT $ 34)) . #3#)
               (LETT |cosz| (SPADCALL |z| (QREFELT $ 35)) . #3#)
               (EXIT
                (COND
                 ((SPADCALL |k| (SPADCALL "tan" (QREFELT $ 38)) (QREFELT $ 40))
                  (SPADCALL |sinz| |cosz| (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "cot" (QREFELT $ 38)) (QREFELT $ 40))
                  (SPADCALL |cosz| |sinz| (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "sec" (QREFELT $ 38)) (QREFELT $ 40))
                  (SPADCALL |cosz| (QREFELT $ 33)))
                 ((SPADCALL |k| (SPADCALL "csc" (QREFELT $ 38)) (QREFELT $ 40))
                  (SPADCALL |sinz| (QREFELT $ 33)))
                 ((SPADCALL |k| (SPADCALL "sinh" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                            (SPADCALL 2 (QREFELT $ 42)) (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "cosh" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 43))
                            (SPADCALL 2 (QREFELT $ 42)) (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "tanh" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                            (SPADCALL |ez| |iez| (QREFELT $ 43))
                            (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "coth" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 43))
                            (SPADCALL |ez| |iez| (QREFELT $ 41))
                            (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "sech" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 43))
                                      (QREFELT $ 33))
                            (QREFELT $ 45)))
                 ((SPADCALL |k| (SPADCALL "csch" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                                      (QREFELT $ 33))
                            (QREFELT $ 45)))
                 ((SPADCALL |k| (SPADCALL "acosh" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL
                   (SPADCALL
                    (SPADCALL
                     (SPADCALL (SPADCALL |z| 2 (QREFELT $ 46))
                               (|spadConstant| $ 10) (QREFELT $ 41))
                     (QREFELT $ 47))
                    |z| (QREFELT $ 43))
                   (QREFELT $ 48)))
                 ((SPADCALL |k| (SPADCALL "atanh" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL
                   (SPADCALL
                    (SPADCALL
                     (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 43))
                     (SPADCALL (|spadConstant| $ 10) |z| (QREFELT $ 41))
                     (QREFELT $ 20))
                    (QREFELT $ 48))
                   (SPADCALL 2 (QREFELT $ 42)) (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "acoth" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL
                   (SPADCALL
                    (SPADCALL
                     (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 43))
                     (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 41))
                     (QREFELT $ 20))
                    (QREFELT $ 48))
                   (SPADCALL 2 (QREFELT $ 42)) (QREFELT $ 20)))
                 ((SPADCALL |k| (SPADCALL "asech" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL
                   (SPADCALL (SPADCALL |z| (QREFELT $ 33))
                             (SPADCALL
                              (SPADCALL
                               (SPADCALL (SPADCALL |z| 2 (QREFELT $ 46))
                                         (QREFELT $ 33))
                               (|spadConstant| $ 10) (QREFELT $ 41))
                              (QREFELT $ 47))
                             (QREFELT $ 43))
                   (QREFELT $ 48)))
                 ((SPADCALL |k| (SPADCALL "acsch" (QREFELT $ 38))
                            (QREFELT $ 40))
                  (SPADCALL
                   (SPADCALL (SPADCALL |z| (QREFELT $ 33))
                             (SPADCALL
                              (SPADCALL (|spadConstant| $ 10)
                                        (SPADCALL
                                         (SPADCALL |z| 2 (QREFELT $ 46))
                                         (QREFELT $ 33))
                                        (QREFELT $ 43))
                              (QREFELT $ 47))
                             (QREFELT $ 43))
                   (QREFELT $ 48)))
                 (#4#
                  (SPADCALL (SPADCALL |k| (QREFELT $ 50)) |args|
                            (QREFELT $ 52))))))))))))) 

(DEFUN |FS2EXPXP;exprToXXP;FEBU;7| (|fcn| |posCheck?| $)
  (|FS2EXPXP;iExprToXXP| (|FS2EXPXP;newElem| |fcn| $) |posCheck?| $)) 

(DEFUN |FS2EXPXP;iExprToXXP| (|fcn| |posCheck?| $)
  (PROG (|ker| |power| #1=#:G788 |expt| #2=#:G784 |prod| |sum| #3=#:G778
         |poly|)
    (RETURN
     (SEQ
      (LETT |poly| (SPADCALL |fcn| (QREFELT $ 57))
            . #4=(|FS2EXPXP;iExprToXXP|))
      (EXIT
       (COND
        ((QEQCAR |poly| 0)
         (CONS 0
               (SPADCALL
                (PROG2
                    (LETT #3#
                          (SPADCALL |fcn| 'NIL "real:two sides" (QREFELT $ 60))
                          . #4#)
                    (QCDR #3#)
                  (|check-union| (QEQCAR #3# 0)
                                 (|UnivariatePuiseuxSeries| (QREFELT $ 7)
                                                            (QREFELT $ 8)
                                                            (QREFELT $ 9))
                                 #3#))
                (QREFELT $ 63))))
        ((QEQCAR (LETT |sum| (SPADCALL |fcn| (QREFELT $ 65)) . #4#) 0)
         (|FS2EXPXP;listToXXP|
          (PROG2
              (LETT #2# |sum| . #4#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          |posCheck?| (|spadConstant| $ 66) (ELT $ 67) $))
        ((QEQCAR (LETT |prod| (SPADCALL |fcn| (QREFELT $ 68)) . #4#) 0)
         (|FS2EXPXP;listToXXP|
          (PROG2
              (LETT #2# |prod| . #4#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          |posCheck?| (|spadConstant| $ 69) (ELT $ 70) $))
        ((QEQCAR (LETT |expt| (|FS2EXPXP;isNonTrivPower| |fcn| $) . #4#) 0)
         (SEQ
          (LETT |power|
                (PROG2
                    (LETT #1# |expt| . #4#)
                    (QCDR #1#)
                  (|check-union| (QEQCAR #1# 0)
                                 (|Record| (|:| |val| (QREFELT $ 7))
                                           (|:| |exponent| (|Integer|)))
                                 #1#))
                . #4#)
          (EXIT
           (|FS2EXPXP;powerToXXP| (QCAR |power|) (QCDR |power|) |posCheck?|
            $))))
        (#5='T
         (SEQ (LETT |ker| (SPADCALL |fcn| (QREFELT $ 72)) . #4#)
              (EXIT
               (COND
                ((QEQCAR |ker| 0)
                 (|FS2EXPXP;kernelToXXP| (QCDR |ker|) |posCheck?| $))
                (#5#
                 (|error|
                  "exprToXXP: neither a sum, product, power, nor kernel")))))))))))) 

(DEFUN |FS2EXPXP;listToXXP| (|list| |posCheck?| |ans| |op| $)
  (PROG (#1=#:G810 |term|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ G190 (COND ((NULL (COND ((NULL |list|) 'NIL) ('T 'T))) (GO G191)))
             (SEQ
              (LETT |term|
                    (|FS2EXPXP;iExprToXXP| (|SPADfirst| |list|) |posCheck?| $)
                    . #2=(|FS2EXPXP;listToXXP|))
              (EXIT
               (COND
                ((QEQCAR |term| 1) (PROGN (LETT #1# |term| . #2#) (GO #1#)))
                ('T
                 (SEQ (LETT |ans| (SPADCALL |ans| (CDR |term|) |op|) . #2#)
                      (EXIT (LETT |list| (CDR |list|) . #2#)))))))
             NIL (GO G190) G191 (EXIT NIL))
        (EXIT (CONS 0 |ans|))))
      #1# (EXIT #1#))))) 

(DEFUN |FS2EXPXP;isNonTrivPower| (|fcn| $)
  (PROG (|power| |expt|)
    (RETURN
     (SEQ
      (LETT |expt| (SPADCALL |fcn| (QREFELT $ 75))
            . #1=(|FS2EXPXP;isNonTrivPower|))
      (EXIT
       (COND ((QEQCAR |expt| 1) (CONS 1 "failed"))
             (#2='T
              (SEQ (LETT |power| (QCDR |expt|) . #1#)
                   (EXIT
                    (COND ((EQL (QCDR |power|) 1) (CONS 1 "failed"))
                          (#2# (CONS 0 |power|)))))))))))) 

(DEFUN |FS2EXPXP;negativePowerOK?| (|upxs| $)
  (PROG (|xOpList| |coef| |deg|)
    (RETURN
     (SEQ
      (LETT |deg| (SPADCALL |upxs| (QREFELT $ 76))
            . #1=(|FS2EXPXP;negativePowerOK?|))
      (SEQ (LETT |coef| (SPADCALL |upxs| |deg| (QREFELT $ 77)) . #1#)
           (EXIT
            (COND
             ((SPADCALL |coef| (|spadConstant| $ 78) (QREFELT $ 79))
              (SEQ
               (LETT |deg|
                     (SPADCALL |upxs|
                               (SPADCALL |deg| (QREFELT $ 14) (QREFELT $ 80))
                               (QREFELT $ 81))
                     . #1#)
               (LETT |coef| (SPADCALL |upxs| |deg| (QREFELT $ 77)) . #1#)
               (EXIT
                (COND
                 ((SPADCALL |coef| (|spadConstant| $ 78) (QREFELT $ 79))
                  (|error|
                   "inverse of series with many leading zero coefficients")))))))))
      (LETT |xOpList| (|FS2EXPXP;opsInvolvingX| |coef| $) . #1#)
      (EXIT
       (COND ((NULL |xOpList|) 'T)
             (#2='T
              (SEQ
               (COND
                ((NULL (CDR |xOpList|))
                 (COND
                  ((SPADCALL (|SPADfirst| |xOpList|)
                             (SPADCALL "log" (QREFELT $ 38)) (QREFELT $ 82))
                   (EXIT 'T)))))
               (EXIT
                (COND ((|FS2EXPXP;productOfNonZeroes?| |coef| $) 'T)
                      (#2# 'NIL))))))))))) 

(DEFUN |FS2EXPXP;powerToXXP| (|fcn| |n| |posCheck?| $)
  (PROG (|nn| #1=#:G838 |rec| |num| |xxp| #2=#:G830 |b|)
    (RETURN
     (SEQ
      (LETT |b| (|FS2EXPXP;iExprToXXP| |fcn| |posCheck?| $)
            . #3=(|FS2EXPXP;powerToXXP|))
      (EXIT
       (COND ((QEQCAR |b| 1) |b|)
             (#4='T
              (SEQ
               (LETT |xxp|
                     (PROG2
                         (LETT #2# |b| . #3#)
                         (QCDR #2#)
                       (|check-union| (QEQCAR #2# 0)
                                      (|ExponentialExpansion| (QREFELT $ 6)
                                                              (QREFELT $ 7)
                                                              (QREFELT $ 8)
                                                              (QREFELT $ 9))
                                      #2#))
                     . #3#)
               (EXIT
                (COND
                 ((OR (< 0 |n|)
                      (< 1
                         (SPADCALL
                          (LETT |num| (SPADCALL |xxp| (QREFELT $ 89)) . #3#)
                          (QREFELT $ 91))))
                  (CONS 0 (SPADCALL |xxp| |n| (QREFELT $ 85))))
                 ((|FS2EXPXP;negativePowerOK?| (SPADCALL |num| (QREFELT $ 92))
                   $)
                  (SEQ (LETT |rec| (SPADCALL |num| (QREFELT $ 94)) . #3#)
                       (EXIT
                        (COND
                         ((QEQCAR |rec| 1) (|error| "FS2EXPXP: can't happen"))
                         (#4#
                          (SEQ
                           (LETT |nn|
                                 (PROG1 (LETT #1# (- |n|) . #3#)
                                   (|check-subtype| (>= #1# 0)
                                                    '(|NonNegativeInteger|)
                                                    #1#))
                                 . #3#)
                           (EXIT
                            (CONS 0
                                  (SPADCALL
                                   (SPADCALL
                                    (SPADCALL (SPADCALL |xxp| (QREFELT $ 95))
                                              |nn| (QREFELT $ 96))
                                    (SPADCALL (QCDR |rec|) |nn| (QREFELT $ 96))
                                    (QREFELT $ 97))
                                   (QREFELT $ 98))))))))))
                 (#4#
                  (|FS2EXPXP;stateProblem| "inv"
                   "lowest order coefficient involves x" $)))))))))))) 

(DEFUN |FS2EXPXP;carefulNthRootIfCan| (|ups| |n| |posCheck?| $)
  (PROG (|ans| #1=#:G866 #2=#:G867 |signum| |coef| |deg|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((< |n| 1) (|error| "nthRoot: n must be positive"))
             (#3='T
              (SEQ
               (EXIT
                (SEQ
                 (LETT |deg| (SPADCALL |ups| (QREFELT $ 76))
                       . #4=(|FS2EXPXP;carefulNthRootIfCan|))
                 (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 77)) . #4#)
                      (EXIT
                       (COND
                        ((SPADCALL |coef| (|spadConstant| $ 78) (QREFELT $ 79))
                         (SEQ
                          (LETT |deg|
                                (SPADCALL |ups|
                                          (SPADCALL |deg| (QREFELT $ 14)
                                                    (QREFELT $ 80))
                                          (QREFELT $ 81))
                                . #4#)
                          (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 77))
                                . #4#)
                          (EXIT
                           (COND
                            ((SPADCALL |coef| (|spadConstant| $ 78)
                                       (QREFELT $ 79))
                             (|error|
                              "log of series with many leading zero coefficients")))))))))
                 (COND
                  ((SPADCALL |n| (QREFELT $ 99))
                   (COND
                    (|posCheck?|
                     (SEQ
                      (LETT |signum| (SPADCALL |coef| (QREFELT $ 102)) . #4#)
                      (EXIT
                       (COND
                        ((QEQCAR |signum| 0)
                         (COND
                          ((EQL (QCDR |signum|) -1)
                           (PROGN
                            (LETT #1#
                                  (PROGN
                                   (LETT #2#
                                         (|FS2EXPXP;stateSeriesProblem|
                                          "nth root" "root of negative number"
                                          $)
                                         . #4#)
                                   (GO #2#))
                                  . #4#)
                            (GO #1#))))))))))))
                 (LETT |ans| (SPADCALL |ups| |n| (QREFELT $ 105)) . #4#)
                 (EXIT
                  (COND
                   ((QEQCAR |ans| 1)
                    (|FS2EXPXP;stateSeriesProblem| "nth root" "no nth root" $))
                   (#3# (CONS 0 (QCDR |ans|)))))))
               #1# (EXIT #1#)))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;nthRootXXPIfCan| (|xxp| |n| |posCheck?| $)
  (PROG (|newDen| |deg| |coef| #1=#:G873 #2=#:G880 #3=#:G874 |root| |newNum|
         |nInv| |den| |num|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |num| (SPADCALL |xxp| (QREFELT $ 89))
              . #4=(|FS2EXPXP;nthRootXXPIfCan|))
        (LETT |den| (SPADCALL |xxp| (QREFELT $ 95)) . #4#)
        (COND
         ((SPADCALL (SPADCALL |num| (QREFELT $ 106)) (QREFELT $ 107))
          (COND
           ((NULL (SPADCALL (SPADCALL |den| (QREFELT $ 106)) (QREFELT $ 107)))
            (EXIT
             (|FS2EXPXP;stateProblem| #5="nth root"
              #6="several monomials in numerator or denominator" $)))))
         (#7='T (EXIT (|FS2EXPXP;stateProblem| #5# #6# $))))
        (LETT |nInv| (SPADCALL 1 |n| (QREFELT $ 13)) . #4#)
        (LETT |newNum|
              (SEQ
               (LETT |coef|
                     (SEQ
                      (LETT |root|
                            (|FS2EXPXP;carefulNthRootIfCan|
                             (SPADCALL |num| (QREFELT $ 92)) |n| |posCheck?| $)
                            . #4#)
                      (EXIT
                       (COND
                        ((QEQCAR |root| 1)
                         (PROGN
                          (LETT #2# (CONS 1 (CDR |root|)) . #4#)
                          (GO #2#)))
                        (#7# (CDR |root|)))))
                     . #4#)
               (LETT |deg|
                     (SPADCALL (SPADCALL |nInv| (QREFELT $ 108))
                               (SPADCALL |num| (QREFELT $ 110))
                               (QREFELT $ 111))
                     . #4#)
               (EXIT (SPADCALL |coef| |deg| (QREFELT $ 112))))
              . #4#)
        (LETT |newDen|
              (SEQ
               (LETT |coef|
                     (SEQ
                      (LETT |root|
                            (|FS2EXPXP;carefulNthRootIfCan|
                             (SPADCALL |den| (QREFELT $ 92)) |n| |posCheck?| $)
                            . #4#)
                      (EXIT
                       (COND
                        ((QEQCAR |root| 1)
                         (PROGN
                          (LETT #2#
                                (CONS 1
                                      (PROG2
                                          (LETT #3# |root| . #4#)
                                          (QCDR #3#)
                                        (|check-union| (QEQCAR #3# 1)
                                                       (|Record|
                                                        (|:| |func| (|String|))
                                                        (|:| |prob|
                                                             (|String|)))
                                                       #3#)))
                                . #4#)
                          (GO #2#)))
                        (#7#
                         (PROG2
                             (LETT #1# |root| . #4#)
                             (QCDR #1#)
                           (|check-union| (QEQCAR #1# 0)
                                          (|UnivariatePuiseuxSeries|
                                           (QREFELT $ 7) (QREFELT $ 8)
                                           (QREFELT $ 9))
                                          #1#))))))
                     . #4#)
               (LETT |deg|
                     (SPADCALL (SPADCALL |nInv| (QREFELT $ 108))
                               (SPADCALL |den| (QREFELT $ 110))
                               (QREFELT $ 111))
                     . #4#)
               (EXIT (SPADCALL |coef| |deg| (QREFELT $ 112))))
              . #4#)
        (EXIT (CONS 0 (SPADCALL |newNum| |newDen| (QREFELT $ 113))))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;nthRootToXXP| (|arg| |n| |posCheck?| $)
  (PROG (|ans| |result|)
    (RETURN
     (SEQ
      (LETT |result| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
            . #1=(|FS2EXPXP;nthRootToXXP|))
      (EXIT
       (COND ((QEQCAR |result| 1) (CONS 1 (CDR |result|)))
             (#2='T
              (SEQ
               (LETT |ans|
                     (|FS2EXPXP;nthRootXXPIfCan| (CDR |result|) |n| |posCheck?|
                      $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |ans| 1) (CONS 1 (CDR |ans|)))
                      (#2# (CONS 0 (CDR |ans|))))))))))))) 

(DEFUN |FS2EXPXP;genPowerToXXP| (|args| |posCheck?| $)
  (PROG (|f| |xxp| |expon| |logBase|)
    (RETURN
     (SEQ
      (LETT |logBase| (|FS2EXPXP;logToXXP| (|SPADfirst| |args|) |posCheck?| $)
            . #1=(|FS2EXPXP;genPowerToXXP|))
      (EXIT
       (COND ((QEQCAR |logBase| 1) |logBase|)
             (#2='T
              (SEQ
               (LETT |expon|
                     (|FS2EXPXP;iExprToXXP| (SPADCALL |args| (QREFELT $ 114))
                      |posCheck?| $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |expon| 1) |expon|)
                      (#2#
                       (SEQ
                        (LETT |xxp|
                              (SPADCALL (CDR |expon|) (CDR |logBase|)
                                        (QREFELT $ 70))
                              . #1#)
                        (LETT |f| (SPADCALL |xxp| (QREFELT $ 115)) . #1#)
                        (EXIT
                         (COND
                          ((QEQCAR |f| 1)
                           (|FS2EXPXP;stateProblem| "exp"
                            "multiply nested exponential" $))
                          (#2#
                           (|FS2EXPXP;exponential| (QCDR |f|) |posCheck?|
                            $)))))))))))))))) 

(DEFUN |FS2EXPXP;kernelToXXP| (|ker| |posCheck?| $)
  (PROG (#1=#:G909 |n| |arg| |args| |sym|)
    (RETURN
     (SEQ
      (LETT |sym| (SPADCALL |ker| (QREFELT $ 117))
            . #2=(|FS2EXPXP;kernelToXXP|))
      (EXIT
       (COND
        ((QEQCAR |sym| 0)
         (COND
          ((EQUAL (QCDR |sym|) (QREFELT $ 8))
           (CONS 0
                 (SPADCALL
                  (SPADCALL (|spadConstant| $ 10) (|spadConstant| $ 87)
                            (QREFELT $ 118))
                  (QREFELT $ 63))))
          (#3='T
           (CONS 0
                 (SPADCALL
                  (SPADCALL (SPADCALL |ker| (QREFELT $ 31))
                            (|spadConstant| $ 84) (QREFELT $ 118))
                  (QREFELT $ 63))))))
        ((NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 29)) . #2#))
         (CONS 0
               (SPADCALL
                (SPADCALL (SPADCALL |ker| (QREFELT $ 31)) (|spadConstant| $ 84)
                          (QREFELT $ 118))
                (QREFELT $ 63))))
        ((NULL (CDR |args|))
         (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
              (EXIT
               (COND
                ((SPADCALL |ker| (SPADCALL "%paren" (QREFELT $ 38))
                           (QREFELT $ 40))
                 (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $))
                ((SPADCALL |ker| (SPADCALL "log" (QREFELT $ 38))
                           (QREFELT $ 40))
                 (|FS2EXPXP;logToXXP| |arg| |posCheck?| $))
                ((SPADCALL |ker| (SPADCALL "exp" (QREFELT $ 38))
                           (QREFELT $ 40))
                 (|FS2EXPXP;expToXXP| |arg| |posCheck?| $))
                (#3# (|FS2EXPXP;tranToXXP| |ker| |arg| |posCheck?| $))))))
        ((SPADCALL |ker| (SPADCALL "%power" (QREFELT $ 38)) (QREFELT $ 40))
         (|FS2EXPXP;genPowerToXXP| |args| |posCheck?| $))
        ((SPADCALL |ker| (SPADCALL "nthRoot" (QREFELT $ 38)) (QREFELT $ 40))
         (SEQ
          (LETT |n|
                (SPADCALL (SPADCALL |args| (QREFELT $ 114)) (QREFELT $ 119))
                . #2#)
          (EXIT
           (|FS2EXPXP;nthRootToXXP| (|SPADfirst| |args|)
            (PROG1 (LETT #1# |n| . #2#)
              (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))
            |posCheck?| $))))
        (#3#
         (|FS2EXPXP;stateProblem|
          (SPADCALL (SPADCALL |ker| (QREFELT $ 120)) (QREFELT $ 121))
          "unknown kernel" $)))))))) 

(DEFUN |FS2EXPXP;genExp| (|ups| |posCheck?| $)
  (PROG (|result| |expCoef| |varOpList| |lc| |deg|)
    (RETURN
     (SEQ
      (LETT |deg| (SPADCALL |ups| (|spadConstant| $ 87) (QREFELT $ 81))
            . #1=(|FS2EXPXP;genExp|))
      (EXIT
       (COND
        ((SPADCALL |deg| (|spadConstant| $ 84) (QREFELT $ 122))
         (|error| "exp of function with sigularity"))
        ((SPADCALL (|spadConstant| $ 84) |deg| (QREFELT $ 122))
         (CONS 0 (SPADCALL |ups| (QREFELT $ 124))))
        (#2='T
         (SEQ
          (LETT |lc| (SPADCALL |ups| (|spadConstant| $ 84) (QREFELT $ 77))
                . #1#)
          (LETT |varOpList| (|FS2EXPXP;opsInvolvingX| |lc| $) . #1#)
          (COND
           ((NULL
             (|FS2EXPXP;opInOpList?| (SPADCALL "log" (QREFELT $ 38))
              |varOpList| $))
            (EXIT (CONS 0 (SPADCALL |ups| (QREFELT $ 124))))))
          (LETT |expCoef|
                (SPADCALL (SPADCALL |lc| (QREFELT $ 32)) (QREFELT $ 8)
                          (QREFELT $ 126))
                . #1#)
          (LETT |result|
                (SPADCALL |expCoef| |posCheck?| "real:right side"
                          (QREFELT $ 127))
                . #1#)
          (EXIT
           (COND
            ((QEQCAR |result| 1) (CONS 0 (SPADCALL |ups| (QREFELT $ 124))))
            (#2#
             (CONS 0
                   (SPADCALL (CDR |result|)
                             (SPADCALL
                              (SPADCALL |ups|
                                        (SPADCALL |lc| (|spadConstant| $ 84)
                                                  (QREFELT $ 118))
                                        (QREFELT $ 128))
                              (QREFELT $ 124))
                             (QREFELT $ 129)))))))))))))) 

(DEFUN |FS2EXPXP;exponential| (|f| |posCheck?| $)
  (PROG (|coef| |expon| |taylorPart| |singPart|)
    (RETURN
     (SEQ
      (LETT |singPart|
            (SPADCALL (SPADCALL |f| (|spadConstant| $ 84) (QREFELT $ 130))
                      (SPADCALL
                       (SPADCALL |f| (|spadConstant| $ 84) (QREFELT $ 77))
                       (QREFELT $ 131))
                      (QREFELT $ 128))
            . #1=(|FS2EXPXP;exponential|))
      (LETT |taylorPart| (SPADCALL |f| |singPart| (QREFELT $ 128)) . #1#)
      (LETT |expon| (SPADCALL |singPart| (QREFELT $ 132)) . #1#)
      (LETT |coef| (|FS2EXPXP;genExp| |taylorPart| |posCheck?| $) . #1#)
      (EXIT
       (COND ((QEQCAR |coef| 1) (CONS 1 (CDR |coef|)))
             ('T
              (CONS 0
                    (SPADCALL (SPADCALL (CDR |coef|) |expon| (QREFELT $ 112))
                              (QREFELT $ 98)))))))))) 

(DEFUN |FS2EXPXP;expToXXP| (|arg| |posCheck?| $)
  (PROG (|f| |xxp| #1=#:G932 |result|)
    (RETURN
     (SEQ
      (LETT |result| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
            . #2=(|FS2EXPXP;expToXXP|))
      (EXIT
       (COND ((QEQCAR |result| 1) |result|)
             (#3='T
              (SEQ
               (LETT |xxp|
                     (PROG2
                         (LETT #1# |result| . #2#)
                         (QCDR #1#)
                       (|check-union| (QEQCAR #1# 0)
                                      (|ExponentialExpansion| (QREFELT $ 6)
                                                              (QREFELT $ 7)
                                                              (QREFELT $ 8)
                                                              (QREFELT $ 9))
                                      #1#))
                     . #2#)
               (LETT |f| (SPADCALL |xxp| (QREFELT $ 115)) . #2#)
               (EXIT
                (COND
                 ((QEQCAR |f| 1)
                  (|FS2EXPXP;stateProblem| "exp" "multiply nested exponential"
                   $))
                 (#3#
                  (|FS2EXPXP;exponential| (QCDR |f|) |posCheck?| $)))))))))))) 

(DEFUN |FS2EXPXP;genLog| (|ups| |posCheck?| $)
  (PROG (|logTerm| |term1| |pow| |mon| |negRat?| |rat| |lt| #1=#:G956 #2=#:G957
         |signum| |coef| |deg|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (EXIT
         (SEQ
          (LETT |deg| (SPADCALL |ups| (QREFELT $ 76)) . #3=(|FS2EXPXP;genLog|))
          (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 77)) . #3#)
               (EXIT
                (COND
                 ((SPADCALL |coef| (|spadConstant| $ 78) (QREFELT $ 79))
                  (SEQ
                   (LETT |deg|
                         (SPADCALL |ups|
                                   (SPADCALL |deg| (QREFELT $ 14)
                                             (QREFELT $ 80))
                                   (QREFELT $ 81))
                         . #3#)
                   (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 77)) . #3#)
                   (EXIT
                    (COND
                     ((SPADCALL |coef| (|spadConstant| $ 78) (QREFELT $ 79))
                      (|error|
                       "log of series with many leading zero coefficients")))))))))
          (COND
           (|posCheck?|
            (SEQ (LETT |signum| (SPADCALL |coef| (QREFELT $ 102)) . #3#)
                 (EXIT
                  (COND
                   ((QEQCAR |signum| 0)
                    (COND
                     ((EQL (QCDR |signum|) -1)
                      (PROGN
                       (LETT #1#
                             (PROGN
                              (LETT #2#
                                    (|FS2EXPXP;stateSeriesProblem| "log"
                                     "negative leading coefficient" $)
                                    . #3#)
                              (GO #2#))
                             . #3#)
                       (GO #1#))))))))))
          (LETT |lt| (SPADCALL |coef| |deg| (QREFELT $ 118)) . #3#)
          (LETT |negRat?|
                (SEQ (LETT |rat| (|FS2EXPXP;ratIfCan| |coef| $) . #3#)
                     (EXIT
                      (COND
                       ((QEQCAR |rat| 0)
                        (COND
                         ((SPADCALL (QCDR |rat|) (|spadConstant| $ 84)
                                    (QREFELT $ 122))
                          'T)
                         (#4='T 'NIL)))
                       (#4# 'NIL))))
                . #3#)
          (LETT |logTerm|
                (SEQ
                 (LETT |mon|
                       (SPADCALL (SPADCALL (QREFELT $ 8) (QREFELT $ 133))
                                 (QREFELT $ 9) (QREFELT $ 41))
                       . #3#)
                 (LETT |pow|
                       (SPADCALL |mon| (SPADCALL |deg| (QREFELT $ 108))
                                 (QREFELT $ 134))
                       . #3#)
                 (EXIT
                  (COND
                   (|negRat?|
                    (SPADCALL (SPADCALL |coef| |pow| (QREFELT $ 135))
                              (QREFELT $ 48)))
                   (#4#
                    (SEQ
                     (LETT |term1|
                           (SPADCALL (SPADCALL |deg| (QREFELT $ 108))
                                     (SPADCALL |mon| (QREFELT $ 48))
                                     (QREFELT $ 135))
                           . #3#)
                     (EXIT
                      (SPADCALL (SPADCALL |coef| (QREFELT $ 48)) |term1|
                                (QREFELT $ 43))))))))
                . #3#)
          (EXIT
           (CONS 0
                 (SPADCALL
                  (SPADCALL |logTerm| (|spadConstant| $ 84) (QREFELT $ 118))
                  (SPADCALL (SPADCALL |ups| |lt| (QREFELT $ 136))
                            (QREFELT $ 137))
                  (QREFELT $ 138))))))
        #1# (EXIT #1#)))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;logToXXP| (|arg| |posCheck?| $)
  (PROG (|denLog| |numLog| |denCoefLog| #1=#:G963 #2=#:G969 #3=#:G964 |res|
         |numCoefLog| |den| |num| |xxp| #4=#:G959 |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
              . #5=(|FS2EXPXP;logToXXP|))
        (EXIT
         (COND ((QEQCAR |result| 1) |result|)
               (#6='T
                (SEQ
                 (LETT |xxp|
                       (PROG2
                           (LETT #4# |result| . #5#)
                           (QCDR #4#)
                         (|check-union| (QEQCAR #4# 0)
                                        (|ExponentialExpansion| (QREFELT $ 6)
                                                                (QREFELT $ 7)
                                                                (QREFELT $ 8)
                                                                (QREFELT $ 9))
                                        #4#))
                       . #5#)
                 (LETT |num| (SPADCALL |xxp| (QREFELT $ 89)) . #5#)
                 (LETT |den| (SPADCALL |xxp| (QREFELT $ 95)) . #5#)
                 (COND
                  ((SPADCALL (SPADCALL |num| (QREFELT $ 106)) (QREFELT $ 107))
                   (COND
                    ((NULL
                      (SPADCALL (SPADCALL |den| (QREFELT $ 106))
                                (QREFELT $ 107)))
                     (EXIT
                      (|FS2EXPXP;stateProblem| #7="log"
                       #8="several monomials in numerator or denominator"
                       $)))))
                  (#6# (EXIT (|FS2EXPXP;stateProblem| #7# #8# $))))
                 (LETT |numCoefLog|
                       (SEQ
                        (LETT |res|
                              (|FS2EXPXP;genLog|
                               (SPADCALL |num| (QREFELT $ 92)) |posCheck?| $)
                              . #5#)
                        (EXIT
                         (COND
                          ((QEQCAR |res| 1)
                           (PROGN
                            (LETT #2# (CONS 1 (CDR |res|)) . #5#)
                            (GO #2#)))
                          (#6# (CDR |res|)))))
                       . #5#)
                 (LETT |denCoefLog|
                       (SEQ
                        (LETT |res|
                              (|FS2EXPXP;genLog|
                               (SPADCALL |den| (QREFELT $ 92)) |posCheck?| $)
                              . #5#)
                        (EXIT
                         (COND
                          ((QEQCAR |res| 1)
                           (PROGN
                            (LETT #2#
                                  (CONS 1
                                        (PROG2
                                            (LETT #3# |res| . #5#)
                                            (QCDR #3#)
                                          (|check-union| (QEQCAR #3# 1)
                                                         (|Record|
                                                          (|:| |func|
                                                               (|String|))
                                                          (|:| |prob|
                                                               (|String|)))
                                                         #3#)))
                                  . #5#)
                            (GO #2#)))
                          (#6#
                           (PROG2
                               (LETT #1# |res| . #5#)
                               (QCDR #1#)
                             (|check-union| (QEQCAR #1# 0)
                                            (|UnivariatePuiseuxSeries|
                                             (QREFELT $ 7) (QREFELT $ 8)
                                             (QREFELT $ 9))
                                            #1#))))))
                       . #5#)
                 (LETT |numLog|
                       (SPADCALL
                        (SPADCALL (SPADCALL |num| (QREFELT $ 110))
                                  (QREFELT $ 139))
                        |numCoefLog| (QREFELT $ 138))
                       . #5#)
                 (LETT |denLog|
                       (SPADCALL
                        (SPADCALL (SPADCALL |den| (QREFELT $ 110))
                                  (QREFELT $ 139))
                        |denCoefLog| (QREFELT $ 138))
                       . #5#)
                 (EXIT
                  (CONS 0
                        (SPADCALL (SPADCALL |numLog| |denLog| (QREFELT $ 128))
                                  (QREFELT $ 63))))))))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;applyIfCan| (|fcn| |arg| |fcnName| |posCheck?| $)
  (PROG (#1=#:G974 |xOpList| |lc| |deg| |upxs| |f| |xxp| #2=#:G971 |xxpArg|)
    (RETURN
     (SEQ
      (LETT |xxpArg| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
            . #3=(|FS2EXPXP;applyIfCan|))
      (EXIT
       (COND ((QEQCAR |xxpArg| 1) |xxpArg|)
             (#4='T
              (SEQ
               (LETT |xxp|
                     (PROG2
                         (LETT #2# |xxpArg| . #3#)
                         (QCDR #2#)
                       (|check-union| (QEQCAR #2# 0)
                                      (|ExponentialExpansion| (QREFELT $ 6)
                                                              (QREFELT $ 7)
                                                              (QREFELT $ 8)
                                                              (QREFELT $ 9))
                                      #2#))
                     . #3#)
               (LETT |f| (SPADCALL |xxp| (QREFELT $ 115)) . #3#)
               (EXIT
                (COND
                 ((QEQCAR |f| 1)
                  (|FS2EXPXP;stateProblem| |fcnName|
                   "multiply nested exponential" $))
                 (#4#
                  (SEQ (LETT |upxs| (QCDR |f|) . #3#)
                       (LETT |deg|
                             (SPADCALL |upxs| (|spadConstant| $ 87)
                                       (QREFELT $ 81))
                             . #3#)
                       (EXIT
                        (COND
                         ((SPADCALL |deg| (|spadConstant| $ 84)
                                    (QREFELT $ 122))
                          (|FS2EXPXP;stateProblem| |fcnName|
                           "essential singularity" $))
                         ((SPADCALL (|spadConstant| $ 84) |deg|
                                    (QREFELT $ 122))
                          (CONS 0
                                (SPADCALL
                                 (PROG2
                                     (LETT #1# (SPADCALL |upxs| |fcn|) . #3#)
                                     (QCDR #1#)
                                   (|check-union| (QEQCAR #1# 0)
                                                  (|UnivariatePuiseuxSeries|
                                                   (QREFELT $ 7) (QREFELT $ 8)
                                                   (QREFELT $ 9))
                                                  #1#))
                                 (QREFELT $ 63))))
                         (#4#
                          (SEQ
                           (LETT |lc|
                                 (SPADCALL |upxs| (|spadConstant| $ 84)
                                           (QREFELT $ 77))
                                 . #3#)
                           (LETT |xOpList| (|FS2EXPXP;opsInvolvingX| |lc| $)
                                 . #3#)
                           (EXIT
                            (COND
                             ((NULL |xOpList|)
                              (CONS 0
                                    (SPADCALL
                                     (PROG2
                                         (LETT #1# (SPADCALL |upxs| |fcn|)
                                               . #3#)
                                         (QCDR #1#)
                                       (|check-union| (QEQCAR #1# 0)
                                                      (|UnivariatePuiseuxSeries|
                                                       (QREFELT $ 7)
                                                       (QREFELT $ 8)
                                                       (QREFELT $ 9))
                                                      #1#))
                                     (QREFELT $ 63))))
                             ((|FS2EXPXP;opInOpList?|
                               (SPADCALL "log" (QREFELT $ 38)) |xOpList| $)
                              (|FS2EXPXP;stateProblem| |fcnName|
                               "logs in constant coefficient" $))
                             ((|FS2EXPXP;contOnReals?| |fcnName| $)
                              (CONS 0
                                    (SPADCALL
                                     (PROG2
                                         (LETT #1# (SPADCALL |upxs| |fcn|)
                                               . #3#)
                                         (QCDR #1#)
                                       (|check-union| (QEQCAR #1# 0)
                                                      (|UnivariatePuiseuxSeries|
                                                       (QREFELT $ 7)
                                                       (QREFELT $ 8)
                                                       (QREFELT $ 9))
                                                      #1#))
                                     (QREFELT $ 63))))
                             (#4#
                              (|FS2EXPXP;stateProblem| |fcnName|
                               "x in constant coefficient" $)))))))))))))))))))) 

(DEFUN |FS2EXPXP;applyBddIfCan| (|fe| |fcn| |arg| |fcnName| |posCheck?| $)
  (PROG (|ans| |f| |xxp| #1=#:G984 |trouble| |xxpArg|)
    (RETURN
     (SEQ
      (LETT |xxpArg| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
            . #2=(|FS2EXPXP;applyBddIfCan|))
      (EXIT
       (COND
        ((QEQCAR |xxpArg| 1)
         (SEQ (LETT |trouble| (CDR |xxpArg|) . #2#)
              (EXIT
               (COND
                ((EQUAL (QCDR |trouble|) "essential singularity")
                 (CONS 0
                       (SPADCALL
                        (SPADCALL |fe| (|spadConstant| $ 84) (QREFELT $ 118))
                        (QREFELT $ 63))))
                (#3='T |xxpArg|)))))
        (#3#
         (SEQ
          (LETT |xxp|
                (PROG2
                    (LETT #1# |xxpArg| . #2#)
                    (QCDR #1#)
                  (|check-union| (QEQCAR #1# 0)
                                 (|ExponentialExpansion| (QREFELT $ 6)
                                                         (QREFELT $ 7)
                                                         (QREFELT $ 8)
                                                         (QREFELT $ 9))
                                 #1#))
                . #2#)
          (LETT |f| (SPADCALL |xxp| (QREFELT $ 115)) . #2#)
          (EXIT
           (COND
            ((QEQCAR |f| 1)
             (|FS2EXPXP;stateProblem| "exp" "multiply nested exponential" $))
            (#3#
             (SEQ (LETT |ans| (SPADCALL (QCDR |f|) |fcn|) . #2#)
                  (EXIT
                   (COND
                    ((QEQCAR |ans| 1)
                     (CONS 0
                           (SPADCALL
                            (SPADCALL |fe| (|spadConstant| $ 84)
                                      (QREFELT $ 118))
                            (QREFELT $ 63))))
                    (#3#
                     (CONS 0
                           (SPADCALL (QCDR |ans|)
                                     (QREFELT $ 63)))))))))))))))))) 

(DEFUN |FS2EXPXP;contOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 140) (QREFELT $ 143))) 

(DEFUN |FS2EXPXP;bddOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 141) (QREFELT $ 143))) 

(DEFUN |FS2EXPXP;opsInvolvingX| (|fcn| $)
  (PROG (|opList| |op| #1=#:G1001 |k| #2=#:G1000)
    (RETURN
     (SEQ
      (LETT |opList|
            (PROGN
             (LETT #2# NIL . #3=(|FS2EXPXP;opsInvolvingX|))
             (SEQ (LETT |k| NIL . #3#)
                  (LETT #1# (SPADCALL |fcn| (QREFELT $ 145)) . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |k| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT
                    (COND
                     ((COND
                       ((SPADCALL
                         (LETT |op| (SPADCALL |k| (QREFELT $ 50)) . #3#)
                         (QREFELT $ 146))
                        (SPADCALL (QREFELT $ 8)
                                  (SPADCALL
                                   (|SPADfirst| (SPADCALL |k| (QREFELT $ 29)))
                                   (QREFELT $ 148))
                                  (QREFELT $ 149)))
                       ('T 'NIL))
                      (LETT #2# (CONS |op| #2#) . #3#)))))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT (SPADCALL |opList| (QREFELT $ 151))))))) 

(DEFUN |FS2EXPXP;opInOpList?| (|name| |opList| $)
  (PROG (#1=#:G1003 #2=#:G1005 #3=#:G1006 |op|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (EXIT
          (SEQ (LETT |op| NIL . #4=(|FS2EXPXP;opInOpList?|))
               (LETT #3# |opList| . #4#) G190
               (COND
                ((OR (ATOM #3#) (PROGN (LETT |op| (CAR #3#) . #4#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (COND
                  ((SPADCALL |op| |name| (QREFELT $ 82))
                   (PROGN
                    (LETT #1# (PROGN (LETT #2# 'T . #4#) (GO #2#)) . #4#)
                    (GO #1#))))))
               (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL)))
         #1# (EXIT #1#))
        (EXIT 'NIL)))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;exponential?| (|fcn| $)
  (PROG (|ker|)
    (RETURN
     (SEQ (LETT |ker| (SPADCALL |fcn| (QREFELT $ 72)) |FS2EXPXP;exponential?|)
          (EXIT
           (COND
            ((QEQCAR |ker| 0)
             (SPADCALL (QCDR |ker|) (SPADCALL "exp" (QREFELT $ 38))
                       (QREFELT $ 40)))
            ('T 'NIL))))))) 

(DEFUN |FS2EXPXP;productOfNonZeroes?| (|fcn| $)
  (PROG (#1=#:G1017 #2=#:G1021 #3=#:G1022 |term| |prod|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((|FS2EXPXP;exponential?| |fcn| $) 'T)
             (#4='T
              (SEQ
               (LETT |prod| (SPADCALL |fcn| (QREFELT $ 68))
                     . #5=(|FS2EXPXP;productOfNonZeroes?|))
               (EXIT
                (COND ((QEQCAR |prod| 1) 'NIL)
                      (#4#
                       (SEQ
                        (SEQ
                         (EXIT
                          (SEQ (LETT |term| NIL . #5#)
                               (LETT #3# (QCDR |prod|) . #5#) G190
                               (COND
                                ((OR (ATOM #3#)
                                     (PROGN (LETT |term| (CAR #3#) . #5#) NIL))
                                 (GO G191)))
                               (SEQ
                                (EXIT
                                 (COND
                                  ((NULL (|FS2EXPXP;exponential?| |term| $))
                                   (COND
                                    ((SPADCALL (QREFELT $ 8)
                                               (SPADCALL |term|
                                                         (QREFELT $ 148))
                                               (QREFELT $ 149))
                                     (PROGN
                                      (LETT #1#
                                            (PROGN
                                             (LETT #2# 'NIL . #5#)
                                             (GO #2#))
                                            . #5#)
                                      (GO #1#))))))))
                               (LETT #3# (CDR #3#) . #5#) (GO G190) G191
                               (EXIT NIL)))
                         #1# (EXIT #1#))
                        (EXIT 'T)))))))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2EXPXP;tranToXXP| (|ker| |arg| |posCheck?| $)
  (COND
   ((SPADCALL |ker| (SPADCALL "sin" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 31)) (ELT $ 152) |arg|
     "sin" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "cos" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 31)) (ELT $ 153) |arg|
     "cos" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "asin" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyIfCan| (ELT $ 154) |arg| "asin" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "acos" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyIfCan| (ELT $ 155) |arg| "acos" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "atan" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;atancotToXXP| (SPADCALL |ker| (QREFELT $ 31)) |arg| |posCheck?|
     1 $))
   ((SPADCALL |ker| (SPADCALL "acot" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;atancotToXXP| (SPADCALL |ker| (QREFELT $ 31)) |arg| |posCheck?|
     -1 $))
   ((SPADCALL |ker| (SPADCALL "asec" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyIfCan| (ELT $ 156) |arg| "asec" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "acsc" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyIfCan| (ELT $ 157) |arg| "acsc" |posCheck?| $))
   ((SPADCALL |ker| (SPADCALL "asinh" (QREFELT $ 38)) (QREFELT $ 40))
    (|FS2EXPXP;applyIfCan| (ELT $ 158) |arg| "asinh" |posCheck?| $))
   ('T
    (|FS2EXPXP;stateProblem|
     (SPADCALL (SPADCALL |ker| (QREFELT $ 120)) (QREFELT $ 121))
     "unknown kernel" $)))) 

(DEFUN |FS2EXPXP;localAbs;2FE;32| (|fcn| $) (SPADCALL |fcn| (QREFELT $ 159))) 

(DEFUN |FS2EXPXP;localAbs;2FE;33| (|fcn| $)
  (SPADCALL (SPADCALL |fcn| |fcn| (QREFELT $ 135)) (QREFELT $ 47))) 

(DEFUN |FS2EXPXP;signOfExpression| (|arg| $)
  (SPADCALL (SPADCALL |arg| (QREFELT $ 160)) |arg| (QREFELT $ 20))) 

(DEFUN |FS2EXPXP;atancotToXXP| (|fe| |arg| |posCheck?| |plusMinus| $)
  (PROG (|cc| |n| |posNegPi2| |signum| |lc| #1=#:G1063 |rn| #2=#:G1061 |yCoef|
         |y| |ord| |coef| |ups| #3=#:G1045 |trouble| |result| |atanFlag|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ (LETT |atanFlag| "real: right side" . #4=(|FS2EXPXP;atancotToXXP|))
            (LETT |posCheck?| 'T . #4#)
            (LETT |result|
                  (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 127))
                  . #4#)
            (EXIT
             (COND
              ((QEQCAR |result| 1)
               (SEQ (LETT |trouble| (CDR |result|) . #4#)
                    (EXIT
                     (COND
                      ((EQUAL (QCDR |trouble|) "essential singularity")
                       (CONS 0
                             (SPADCALL
                              (SPADCALL |fe| (|spadConstant| $ 84)
                                        (QREFELT $ 118))
                              (QREFELT $ 63))))
                      (#5='T (CONS 1 (CDR |result|)))))))
              (#5#
               (SEQ
                (EXIT
                 (SEQ
                  (LETT |ups|
                        (PROG2
                            (LETT #3# |result| . #4#)
                            (QCDR #3#)
                          (|check-union| (QEQCAR #3# 0)
                                         (|UnivariatePuiseuxSeries|
                                          (QREFELT $ 7) (QREFELT $ 8)
                                          (QREFELT $ 9))
                                         #3#))
                        . #4#)
                  (LETT |coef|
                        (SPADCALL |ups| (|spadConstant| $ 84) (QREFELT $ 77))
                        . #4#)
                  (SEQ
                   (LETT |ord|
                         (SPADCALL |ups| (|spadConstant| $ 84) (QREFELT $ 81))
                         . #4#)
                   (EXIT
                    (COND
                     ((SPADCALL |ord| (|spadConstant| $ 84) (QREFELT $ 161))
                      (COND
                       ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 135))
                                  (SPADCALL (|spadConstant| $ 10)
                                            (QREFELT $ 162))
                                  (QREFELT $ 79))
                        (PROGN
                         (LETT #2#
                               (SEQ
                                (LETT |y|
                                      (SPADCALL
                                       (SPADCALL |ups| (QREFELT $ 163))
                                       (SPADCALL (|spadConstant| $ 164)
                                                 (SPADCALL |ups| |ups|
                                                           (QREFELT $ 129))
                                                 (QREFELT $ 138))
                                       (QREFELT $ 136))
                                      . #4#)
                                (LETT |yCoef|
                                      (SPADCALL |y|
                                                (SPADCALL (|spadConstant| $ 87)
                                                          (QREFELT $ 165))
                                                (QREFELT $ 77))
                                      . #4#)
                                (EXIT
                                 (CONS 0
                                       (SPADCALL
                                        (SPADCALL
                                         (SPADCALL
                                          (SPADCALL |yCoef| (QREFELT $ 48))
                                          (|spadConstant| $ 84)
                                          (QREFELT $ 118))
                                         (SPADCALL
                                          (SPADCALL |y|
                                                    (SPADCALL |yCoef|
                                                              (SPADCALL
                                                               (|spadConstant|
                                                                $ 87)
                                                               (QREFELT $ 165))
                                                              (QREFELT $ 118))
                                                    (QREFELT $ 128))
                                          (QREFELT $ 166))
                                         (QREFELT $ 138))
                                        (QREFELT $ 63)))))
                               . #4#)
                         (GO #2#))))))))
                  (LETT |cc|
                        (COND
                         ((SPADCALL |ord| (|spadConstant| $ 84)
                                    (QREFELT $ 122))
                          (SEQ
                           (LETT |rn|
                                 (|FS2EXPXP;ratIfCan|
                                  (SPADCALL |ord| (QREFELT $ 108)) $)
                                 . #4#)
                           (EXIT
                            (COND
                             ((QEQCAR |rn| 1)
                              (PROGN
                               (LETT #1#
                                     (|FS2EXPXP;stateProblem| "atan"
                                      "branch problem" $)
                                     . #4#)
                               (GO #1#)))
                             (#5#
                              (SEQ
                               (LETT |lc| (SPADCALL |ups| |ord| (QREFELT $ 77))
                                     . #4#)
                               (LETT |signum| (SPADCALL |lc| (QREFELT $ 102))
                                     . #4#)
                               (EXIT
                                (COND
                                 ((QEQCAR |signum| 1)
                                  (SEQ
                                   (LETT |posNegPi2|
                                         (SPADCALL
                                          (SPADCALL
                                           (|FS2EXPXP;signOfExpression| |lc| $)
                                           (SPADCALL (QREFELT $ 167))
                                           (QREFELT $ 135))
                                          (SPADCALL 2 (QREFELT $ 42))
                                          (QREFELT $ 20))
                                         . #4#)
                                   (EXIT
                                    (COND ((EQL |plusMinus| 1) |posNegPi2|)
                                          (#5#
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL (QREFELT $ 167))
                                             (SPADCALL 2 (QREFELT $ 42))
                                             (QREFELT $ 20))
                                            |posNegPi2| (QREFELT $ 41)))))))
                                 ((EQL (LETT |n| (QCDR |signum|) . #4#) -1)
                                  (COND
                                   ((EQL |plusMinus| 1)
                                    (SPADCALL
                                     (SPADCALL (SPADCALL (QREFELT $ 167))
                                               (SPADCALL 2 (QREFELT $ 42))
                                               (QREFELT $ 20))
                                     (QREFELT $ 162)))
                                   (#5# (SPADCALL (QREFELT $ 167)))))
                                 ((EQL |plusMinus| 1)
                                  (SPADCALL (SPADCALL (QREFELT $ 167))
                                            (SPADCALL 2 (QREFELT $ 42))
                                            (QREFELT $ 20)))
                                 (#5# (|spadConstant| $ 78))))))))))
                         (#5# (SPADCALL |coef| (QREFELT $ 169))))
                        . #4#)
                  (EXIT
                   (CONS 0
                         (SPADCALL
                          (SPADCALL (SPADCALL |cc| (QREFELT $ 131))
                                    (SPADCALL
                                     (SPADCALL (SPADCALL |ups| (QREFELT $ 163))
                                               (SPADCALL (|spadConstant| $ 164)
                                                         (SPADCALL |ups| |ups|
                                                                   (QREFELT $
                                                                            129))
                                                         (QREFELT $ 138))
                                               (QREFELT $ 136))
                                     (QREFELT $ 166))
                                    (QREFELT $ 138))
                          (QREFELT $ 63))))))
                #2# (EXIT #2#)))))))
      #1# (EXIT #1#))))) 

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

(DEFUN |FunctionSpaceToExponentialExpansion;| (|#1| |#2| |#3| |#4|)
  (PROG (|pv$| $ |dv$| DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|)
            . #1=(|FunctionSpaceToExponentialExpansion|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT |dv$|
            (LIST '|FunctionSpaceToExponentialExpansion| DV$1 DV$2 DV$3 DV$4)
            . #1#)
      (LETT $ (GETREFV 170) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|FunctionSpaceToExponentialExpansion|
                  (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 $ 14 (SPADCALL 1000 1 (QREFELT $ 13)))
      (QSETREFV $ 140
                (LIST #2="sin" #3="cos" #4="atan" #5="acot" "exp" "asinh"))
      (QSETREFV $ 141 (LIST #2# #3# #4# #5#))
      (COND
       ((|HasSignature| |#2|
                        (LIST '|abs|
                              (LIST (|devaluate| |#2|) (|devaluate| |#2|))))
        (QSETREFV $ 160
                  (CONS (|dispatchFunction| |FS2EXPXP;localAbs;2FE;32|) $)))
       ('T
        (QSETREFV $ 160
                  (CONS (|dispatchFunction| |FS2EXPXP;localAbs;2FE;33|) $))))
      $)))) 

(MAKEPROP '|FunctionSpaceToExponentialExpansion| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (0 . |One|) (|Integer|)
              (|Fraction| 11) (4 . /) 'ZEROCOUNT (|Union| 12 '#1="failed")
              (10 . |retractIfCan|) (|SparseMultivariatePolynomial| 6 30)
              (15 . |numer|) (20 . |denom|) (25 . /) (31 . |coerce|)
              (|Mapping| 7 28) (|Mapping| 7 6)
              (|SparseMultivariatePolynomial| 6 28)
              (|PolynomialCategoryLifting| (|IndexedExponents| 28) 28 6 24 7)
              (36 . |map|) (|List| 7) (|Kernel| 7) (43 . |argument|)
              (|Kernel| $) (48 . |coerce|) (53 . |exp|) (58 . |inv|)
              (63 . |sin|) (68 . |cos|) (|String|) (|Symbol|) (73 . |coerce|)
              (|Boolean|) (78 . |is?|) (84 . -) (90 . |coerce|) (95 . +)
              (|PositiveInteger|) (101 . *) (107 . ^) (113 . |sqrt|)
              (118 . |log|) (|BasicOperator|) (123 . |operator|) (|List| $)
              (128 . |elt|) (|Record| (|:| |func| 36) (|:| |prob| 36))
              (|Union| (|:| |%expansion| 62) (|:| |%problem| 53))
              |FS2EXPXP;exprToXXP;FEBU;7| (|Union| (|Polynomial| 6) '#1#)
              (134 . |retractIfCan|)
              (|Union| (|:| |%series| 61) (|:| |%problem| 53))
              (|FunctionSpaceToUnivariatePowerSeries| 6 7 12 61 104 8)
              (139 . |exprToUPS|) (|UnivariatePuiseuxSeries| 7 8 9)
              (|ExponentialExpansion| 6 7 8 9) (146 . |coerce|)
              (|Union| 51 '#2="failed") (151 . |isPlus|) (156 . |Zero|)
              (160 . +) (166 . |isTimes|) (171 . |One|) (175 . *)
              (|Union| 30 '#1#) (181 . |retractIfCan|)
              (|Record| (|:| |val| $) (|:| |exponent| 11)) (|Union| 73 '#2#)
              (186 . |isPower|) (191 . |degree|) (196 . |coefficient|)
              (202 . |Zero|) (206 . =) (212 . +) (218 . |order|) (224 . |is?|)
              (230 . |Zero|) (234 . |Zero|) (238 . ^) (244 . |One|)
              (248 . |One|)
              (|UnivariatePuiseuxSeriesWithExponentialSingularity| 6 7 8 9)
              (252 . |numer|) (|NonNegativeInteger|)
              (257 . |numberOfMonomials|) (262 . |leadingCoefficient|)
              (|Union| $ '"failed") (267 . |recip|) (272 . |denom|) (277 . ^)
              (283 . *) (289 . |coerce|) (294 . |even?|) (|Union| 11 '"failed")
              (|ElementaryFunctionSign| 6 7) (299 . |sign|)
              (|Union| 61 '"failed")
              (|ElementaryFunctionsUnivariatePuiseuxSeries| 7
                                                            (|UnivariateLaurentSeries|
                                                             7 8 9)
                                                            61
                                                            (|ElementaryFunctionsUnivariateLaurentSeries|
                                                             7
                                                             (|UnivariateTaylorSeries|
                                                              7 8 9)
                                                             (|UnivariateLaurentSeries|
                                                              7 8 9)))
              (304 . |nthRootIfCan|) (310 . |reductum|) (315 . |zero?|)
              (320 . |coerce|) (|ExponentialOfUnivariatePuiseuxSeries| 7 8 9)
              (325 . |degree|) (330 . *) (336 . |monomial|) (342 . /)
              (348 . |second|) (353 . |retractIfCan|) (|Union| 37 '"failed")
              (358 . |symbolIfCan|) (363 . |monomial|) (369 . |retract|)
              (374 . |name|) (379 . |string|) (384 . <) (390 . |Zero|)
              (394 . |exp|) (|ElementaryFunctionStructurePackage| 6 7)
              (399 . |normalize|) (405 . |exprToGenUPS|) (412 . -) (418 . *)
              (424 . |truncate|) (430 . |coerce|) (435 . |exponential|)
              (440 . |coerce|) (445 . ^) (451 . *) (457 . /) (463 . |log|)
              (468 . +) (474 . |exponent|) 'CONTFCNS 'BDDFCNS (|List| 36)
              (479 . |member?|) (|List| 30) (485 . |tower|) (490 . |unary?|)
              (|List| 37) (495 . |variables|) (500 . |member?|) (|List| 49)
              (506 . |removeDuplicates|) (511 . |sinIfCan|) (516 . |cosIfCan|)
              (521 . |asinIfCan|) (526 . |acosIfCan|) (531 . |asecIfCan|)
              (536 . |acscIfCan|) (541 . |asinhIfCan|) (546 . |abs|)
              (551 . |localAbs|) (556 . =) (562 . -) (567 . |differentiate|)
              (572 . |One|) (576 . -) (581 . |integrate|) (586 . |pi|)
              (590 . |pi|) (594 . |atan|))
           '#(|localAbs| 599 |exprToXXP| 604) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 169
                                                 '(0 7 0 10 2 12 0 11 11 13 1 7
                                                   15 0 16 1 7 17 0 18 1 7 17 0
                                                   19 2 7 0 0 0 20 1 7 0 6 21 3
                                                   25 7 22 23 24 26 1 28 27 0
                                                   29 1 7 0 30 31 1 7 0 0 32 1
                                                   7 0 0 33 1 7 0 0 34 1 7 0 0
                                                   35 1 37 0 36 38 2 28 39 0 37
                                                   40 2 7 0 0 0 41 1 7 0 11 42
                                                   2 7 0 0 0 43 2 7 0 44 0 45 2
                                                   7 0 0 44 46 1 7 0 0 47 1 7 0
                                                   0 48 1 28 49 0 50 2 7 0 49
                                                   51 52 1 7 56 0 57 3 59 58 7
                                                   39 36 60 1 62 0 61 63 1 7 64
                                                   0 65 0 62 0 66 2 62 0 0 0 67
                                                   1 7 64 0 68 0 62 0 69 2 62 0
                                                   0 0 70 1 7 71 0 72 1 7 74 0
                                                   75 1 61 12 0 76 2 61 7 0 12
                                                   77 0 7 0 78 2 7 39 0 0 79 2
                                                   12 0 0 0 80 2 61 12 0 12 81
                                                   2 49 39 0 37 82 0 6 0 83 0
                                                   12 0 84 2 62 0 0 11 85 0 6 0
                                                   86 0 12 0 87 1 62 88 0 89 1
                                                   88 90 0 91 1 88 61 0 92 1 88
                                                   93 0 94 1 62 88 0 95 2 88 0
                                                   0 90 96 2 88 0 0 0 97 1 62 0
                                                   88 98 1 11 39 0 99 1 101 100
                                                   7 102 2 104 103 61 90 105 1
                                                   88 0 0 106 1 88 39 0 107 1 7
                                                   0 12 108 1 88 109 0 110 2
                                                   109 0 7 0 111 2 88 0 61 109
                                                   112 2 62 0 88 88 113 1 27 7
                                                   0 114 1 62 103 0 115 1 28
                                                   116 0 117 2 61 0 7 12 118 1
                                                   7 11 0 119 1 28 37 0 120 1
                                                   37 36 0 121 2 12 39 0 0 122
                                                   0 61 0 123 1 104 61 61 124 2
                                                   125 7 7 37 126 3 59 58 7 39
                                                   36 127 2 61 0 0 0 128 2 61 0
                                                   0 0 129 2 61 0 0 12 130 1 61
                                                   0 7 131 1 109 0 61 132 1 7 0
                                                   37 133 2 7 0 0 0 134 2 7 0 0
                                                   0 135 2 61 0 0 0 136 1 104
                                                   61 61 137 2 61 0 0 0 138 1
                                                   109 61 0 139 2 142 39 36 0
                                                   143 1 7 144 0 145 1 49 39 0
                                                   146 1 7 147 0 148 2 147 39
                                                   37 0 149 1 150 0 0 151 1 104
                                                   103 61 152 1 104 103 61 153
                                                   1 104 103 61 154 1 104 103
                                                   61 155 1 104 103 61 156 1
                                                   104 103 61 157 1 104 103 61
                                                   158 1 7 0 0 159 1 0 7 7 160
                                                   2 12 39 0 0 161 1 7 0 0 162
                                                   1 61 0 0 163 0 61 0 164 1 12
                                                   0 0 165 1 61 0 0 166 0 7 0
                                                   167 0 61 0 168 1 7 0 0 169 1
                                                   0 7 7 160 2 0 54 7 39
                                                   55)))))
           '|lookupComplete|)) 
