
(SDEFUN |FS2EXPXP;ratIfCan|
        ((|fcn| FE) ($ |Union| (|Fraction| (|Integer|)) "failed"))
        (SPADCALL |fcn| (QREFELT $ 16))) 

(SDEFUN |FS2EXPXP;stateSeriesProblem|
        ((|function| |String|) (|problem| |String|)
         ($ |Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (CONS 1 (CONS |function| |problem|))) 

(SDEFUN |FS2EXPXP;stateProblem|
        ((|function| |String|) (|problem| |String|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (CONS 1 (CONS |function| |problem|))) 

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

(SDEFUN |FS2EXPXP;smpElem|
        ((|p| |SparseMultivariatePolynomial| R (|Kernel| FE)) ($ FE))
        (SPADCALL (CONS (|function| |FS2EXPXP;k2Elem|) $) (ELT $ 21) |p|
                  (QREFELT $ 26))) 

(SDEFUN |FS2EXPXP;k2Elem| ((|k| |Kernel| FE) ($ FE))
        (SPROG
         ((|cosz| (FE)) (|sinz| (FE)) (|iez| (FE)) (|ez| (FE)) (|z| (FE))
          (|args| (|List| FE)) (#1=#:G813 NIL) (|a| NIL) (#2=#:G812 NIL))
         (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 (NREVERSE #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| '|tan| (QREFELT $ 38))
                      (SPADCALL |sinz| |cosz| (QREFELT $ 20)))
                     ((SPADCALL |k| '|cot| (QREFELT $ 38))
                      (SPADCALL |cosz| |sinz| (QREFELT $ 20)))
                     ((SPADCALL |k| '|sec| (QREFELT $ 38))
                      (SPADCALL |cosz| (QREFELT $ 33)))
                     ((SPADCALL |k| '|csc| (QREFELT $ 38))
                      (SPADCALL |sinz| (QREFELT $ 33)))
                     ((SPADCALL |k| '|sinh| (QREFELT $ 38))
                      (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 39))
                                (SPADCALL 2 (QREFELT $ 40)) (QREFELT $ 20)))
                     ((SPADCALL |k| '|cosh| (QREFELT $ 38))
                      (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                                (SPADCALL 2 (QREFELT $ 40)) (QREFELT $ 20)))
                     ((SPADCALL |k| '|tanh| (QREFELT $ 38))
                      (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 39))
                                (SPADCALL |ez| |iez| (QREFELT $ 41))
                                (QREFELT $ 20)))
                     ((SPADCALL |k| '|coth| (QREFELT $ 38))
                      (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                                (SPADCALL |ez| |iez| (QREFELT $ 39))
                                (QREFELT $ 20)))
                     ((SPADCALL |k| '|sech| (QREFELT $ 38))
                      (SPADCALL 2
                                (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 41))
                                          (QREFELT $ 33))
                                (QREFELT $ 43)))
                     ((SPADCALL |k| '|csch| (QREFELT $ 38))
                      (SPADCALL 2
                                (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 39))
                                          (QREFELT $ 33))
                                (QREFELT $ 43)))
                     ((SPADCALL |k| '|acosh| (QREFELT $ 38))
                      (SPADCALL
                       (SPADCALL
                        (SPADCALL
                         (SPADCALL (SPADCALL |z| 2 (QREFELT $ 44))
                                   (|spadConstant| $ 10) (QREFELT $ 39))
                         (QREFELT $ 45))
                        |z| (QREFELT $ 41))
                       (QREFELT $ 46)))
                     ((SPADCALL |k| '|atanh| (QREFELT $ 38))
                      (SPADCALL
                       (SPADCALL
                        (SPADCALL
                         (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 41))
                         (SPADCALL (|spadConstant| $ 10) |z| (QREFELT $ 39))
                         (QREFELT $ 20))
                        (QREFELT $ 46))
                       (SPADCALL 2 (QREFELT $ 40)) (QREFELT $ 20)))
                     ((SPADCALL |k| '|acoth| (QREFELT $ 38))
                      (SPADCALL
                       (SPADCALL
                        (SPADCALL
                         (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 41))
                         (SPADCALL |z| (|spadConstant| $ 10) (QREFELT $ 39))
                         (QREFELT $ 20))
                        (QREFELT $ 46))
                       (SPADCALL 2 (QREFELT $ 40)) (QREFELT $ 20)))
                     ((SPADCALL |k| '|asech| (QREFELT $ 38))
                      (SPADCALL
                       (SPADCALL (SPADCALL |z| (QREFELT $ 33))
                                 (SPADCALL
                                  (SPADCALL
                                   (SPADCALL (SPADCALL |z| 2 (QREFELT $ 44))
                                             (QREFELT $ 33))
                                   (|spadConstant| $ 10) (QREFELT $ 39))
                                  (QREFELT $ 45))
                                 (QREFELT $ 41))
                       (QREFELT $ 46)))
                     ((SPADCALL |k| '|acsch| (QREFELT $ 38))
                      (SPADCALL
                       (SPADCALL (SPADCALL |z| (QREFELT $ 33))
                                 (SPADCALL
                                  (SPADCALL (|spadConstant| $ 10)
                                            (SPADCALL
                                             (SPADCALL |z| 2 (QREFELT $ 44))
                                             (QREFELT $ 33))
                                            (QREFELT $ 41))
                                  (QREFELT $ 45))
                                 (QREFELT $ 41))
                       (QREFELT $ 46)))
                     (#4#
                      (SPADCALL (SPADCALL |k| (QREFELT $ 48)) |args|
                                (QREFELT $ 50)))))))))))) 

(SDEFUN |FS2EXPXP;exprToXXP;FEBU;7|
        ((|fcn| FE) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (|FS2EXPXP;iExprToXXP| (|FS2EXPXP;newElem| |fcn| $) |posCheck?| $)) 

(SDEFUN |FS2EXPXP;iExprToXXP|
        ((|fcn| FE) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|ker| (|Union| (|Kernel| FE) #1="failed"))
          (|power| (|Record| (|:| |val| FE) (|:| |exponent| (|Integer|))))
          (|expt|
           (|Union| (|Record| (|:| |val| FE) (|:| |exponent| (|Integer|)))
                    "failed"))
          (|prod| (|Union| (|List| FE) #2="failed"))
          (|sum| (|Union| (|List| FE) #2#)) (#3=#:G839 NIL)
          (|poly| (|Union| (|Polynomial| R) #1#)))
         (SEQ
          (LETT |poly| (SPADCALL |fcn| (QREFELT $ 55))
                . #4=(|FS2EXPXP;iExprToXXP|))
          (EXIT
           (COND
            ((QEQCAR |poly| 0)
             (CONS 0
                   (SPADCALL
                    (PROG2
                        (LETT #3#
                              (SPADCALL |fcn| NIL (CONS 1 "real: two sides")
                                        (QREFELT $ 59))
                              . #4#)
                        (QCDR #3#)
                      (|check_union2| (QEQCAR #3# 0)
                                      (|UnivariatePuiseuxSeries| (QREFELT $ 7)
                                                                 (QREFELT $ 8)
                                                                 (QREFELT $ 9))
                                      (|Union|
                                       (|:| |%series|
                                            (|UnivariatePuiseuxSeries|
                                             (QREFELT $ 7) (QREFELT $ 8)
                                             (QREFELT $ 9)))
                                       (|:| |%problem|
                                            (|Record| (|:| |func| (|String|))
                                                      (|:| |prob|
                                                           (|String|)))))
                                      #3#))
                    (QREFELT $ 62))))
            (#5='T
             (SEQ (LETT |sum| (SPADCALL |fcn| (QREFELT $ 64)) . #4#)
                  (EXIT
                   (COND
                    ((QEQCAR |sum| 0)
                     (|FS2EXPXP;listToXXP| (QCDR |sum|) |posCheck?|
                      (|spadConstant| $ 65) (ELT $ 66) $))
                    (#5#
                     (SEQ (LETT |prod| (SPADCALL |fcn| (QREFELT $ 67)) . #4#)
                          (EXIT
                           (COND
                            ((QEQCAR |prod| 0)
                             (|FS2EXPXP;listToXXP| (QCDR |prod|) |posCheck?|
                              (|spadConstant| $ 68) (ELT $ 69) $))
                            (#5#
                             (SEQ
                              (LETT |expt| (|FS2EXPXP;isNonTrivPower| |fcn| $)
                                    . #4#)
                              (EXIT
                               (COND
                                ((QEQCAR |expt| 0)
                                 (SEQ (LETT |power| (QCDR |expt|) . #4#)
                                      (EXIT
                                       (|FS2EXPXP;powerToXXP| (QCAR |power|)
                                        (QCDR |power|) |posCheck?| $))))
                                (#5#
                                 (SEQ
                                  (LETT |ker| (SPADCALL |fcn| (QREFELT $ 71))
                                        . #4#)
                                  (EXIT
                                   (COND
                                    ((QEQCAR |ker| 0)
                                     (|FS2EXPXP;kernelToXXP| (QCDR |ker|)
                                      |posCheck?| $))
                                    (#5#
                                     (|error|
                                      "exprToXXP: neither a sum, product, power, nor kernel"))))))))))))))))))))))) 

(SDEFUN |FS2EXPXP;listToXXP|
        ((|list| |List| FE) (|posCheck?| |Boolean|)
         (|ans| |ExponentialExpansion| R FE |x| |cen|)
         (|op| |Mapping| (|ExponentialExpansion| R FE |x| |cen|)
          (|ExponentialExpansion| R FE |x| |cen|)
          (|ExponentialExpansion| R FE |x| |cen|))
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((#1=#:G866 NIL)
          (|term|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (EXIT
           (SEQ
            (SEQ G190 (COND ((NULL |list|) (GO G191)))
                 (SEQ
                  (LETT |term|
                        (|FS2EXPXP;iExprToXXP| (|SPADfirst| |list|) |posCheck?|
                         $)
                        . #2=(|FS2EXPXP;listToXXP|))
                  (EXIT
                   (COND
                    ((QEQCAR |term| 1)
                     (PROGN (LETT #1# |term| . #2#) (GO #3=#:G865)))
                    ('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|))))
          #3# (EXIT #1#)))) 

(SDEFUN |FS2EXPXP;isNonTrivPower|
        ((|fcn| FE)
         ($ |Union| (|Record| (|:| |val| FE) (|:| |exponent| (|Integer|)))
          "failed"))
        (SPROG
         ((|power| (|Record| (|:| |val| FE) (|:| |exponent| (|Integer|))))
          (|expt|
           (|Union| (|Record| (|:| |val| FE) (|:| |exponent| (|Integer|)))
                    "failed")))
         (SEQ
          (LETT |expt| (SPADCALL |fcn| (QREFELT $ 74))
                . #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|))))))))))) 

(SDEFUN |FS2EXPXP;negativePowerOK?|
        ((|upxs| |UnivariatePuiseuxSeries| FE |x| |cen|) ($ |Boolean|))
        (SPROG
         ((|xOpList| (|List| (|BasicOperator|))) (|coef| (FE))
          (|deg| (|Fraction| (|Integer|))))
         (SEQ
          (LETT |deg| (SPADCALL |upxs| (QREFELT $ 75))
                . #1=(|FS2EXPXP;negativePowerOK?|))
          (SEQ (LETT |coef| (SPADCALL |upxs| |deg| (QREFELT $ 76)) . #1#)
               (EXIT
                (COND
                 ((SPADCALL |coef| (|spadConstant| $ 77) (QREFELT $ 78))
                  (SEQ
                   (LETT |deg|
                         (SPADCALL |upxs|
                                   (SPADCALL |deg| (QREFELT $ 14)
                                             (QREFELT $ 79))
                                   (QREFELT $ 80))
                         . #1#)
                   (LETT |coef| (SPADCALL |upxs| |deg| (QREFELT $ 76)) . #1#)
                   (EXIT
                    (COND
                     ((SPADCALL |coef| (|spadConstant| $ 77) (QREFELT $ 78))
                      (|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|) '|log| (QREFELT $ 81))
                       (EXIT 'T)))))
                   (EXIT
                    (COND ((|FS2EXPXP;productOfNonZeroes?| |coef| $) 'T)
                          (#2# NIL)))))))))) 

(SDEFUN |FS2EXPXP;powerToXXP|
        ((|fcn| FE) (|n| |Integer|) (|posCheck?| |Boolean|)
         ($ |Union|
          (|:| |%expansion| #1=(|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|nn| (|NonNegativeInteger|)) (#2=#:G888 NIL)
          (|rec|
           (|Union|
            (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                 |cen|)
            "failed"))
          (|num|
           (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                |cen|))
          (|xxp| #1#) (#3=#:G882 NIL)
          (|b|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (LETT |b| (|FS2EXPXP;iExprToXXP| |fcn| |posCheck?| $)
                . #4=(|FS2EXPXP;powerToXXP|))
          (EXIT
           (COND ((QEQCAR |b| 1) |b|)
                 (#5='T
                  (SEQ
                   (LETT |xxp|
                         (PROG2 (LETT #3# |b| . #4#)
                             (QCDR #3#)
                           (|check_union2| (QEQCAR #3# 0)
                                           (|ExponentialExpansion|
                                            (QREFELT $ 6) (QREFELT $ 7)
                                            (QREFELT $ 8) (QREFELT $ 9))
                                           (|Union|
                                            (|:| |%expansion|
                                                 (|ExponentialExpansion|
                                                  (QREFELT $ 6) (QREFELT $ 7)
                                                  (QREFELT $ 8) (QREFELT $ 9)))
                                            (|:| |%problem|
                                                 (|Record|
                                                  (|:| |func| (|String|))
                                                  (|:| |prob| (|String|)))))
                                           #3#))
                         . #4#)
                   (EXIT
                    (COND
                     ((OR (SPADCALL |n| 0 (QREFELT $ 82))
                          (SPADCALL
                           (SPADCALL
                            (LETT |num| (SPADCALL |xxp| (QREFELT $ 85)) . #4#)
                            (QREFELT $ 87))
                           1 (QREFELT $ 88)))
                      (CONS 0 (SPADCALL |xxp| |n| (QREFELT $ 83))))
                     ((|FS2EXPXP;negativePowerOK?|
                       (SPADCALL |num| (QREFELT $ 89)) $)
                      (SEQ (LETT |rec| (SPADCALL |num| (QREFELT $ 91)) . #4#)
                           (EXIT
                            (COND
                             ((QEQCAR |rec| 1)
                              (|error| "FS2EXPXP: can't happen"))
                             (#5#
                              (SEQ
                               (LETT |nn|
                                     (PROG1 (LETT #2# (- |n|) . #4#)
                                       (|check_subtype2| (>= #2# 0)
                                                         '(|NonNegativeInteger|)
                                                         '(|Integer|) #2#))
                                     . #4#)
                               (EXIT
                                (CONS 0
                                      (SPADCALL
                                       (SPADCALL
                                        (SPADCALL
                                         (SPADCALL |xxp| (QREFELT $ 92)) |nn|
                                         (QREFELT $ 93))
                                        (SPADCALL (QCDR |rec|) |nn|
                                                  (QREFELT $ 93))
                                        (QREFELT $ 94))
                                       (QREFELT $ 95))))))))))
                     (#5#
                      (|FS2EXPXP;stateProblem| "inv"
                       "lowest order coefficient involves x" $))))))))))) 

(SDEFUN |FS2EXPXP;carefulNthRootIfCan|
        ((|ups| |UnivariatePuiseuxSeries| FE |x| |cen|)
         (|n| |NonNegativeInteger|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|ans| (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed"))
          (#1=#:G914 NIL) (#2=#:G915 NIL)
          (|signum| (|Union| (|Integer|) "failed")) (|coef| (FE))
          (|deg| (|Fraction| (|Integer|))))
         (SEQ
          (EXIT
           (COND ((< |n| 1) (|error| "nthRoot: n must be positive"))
                 (#3='T
                  (SEQ
                   (EXIT
                    (SEQ
                     (LETT |deg| (SPADCALL |ups| (QREFELT $ 75))
                           . #4=(|FS2EXPXP;carefulNthRootIfCan|))
                     (SEQ
                      (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 76)) . #4#)
                      (EXIT
                       (COND
                        ((SPADCALL |coef| (|spadConstant| $ 77) (QREFELT $ 78))
                         (SEQ
                          (LETT |deg|
                                (SPADCALL |ups|
                                          (SPADCALL |deg| (QREFELT $ 14)
                                                    (QREFELT $ 79))
                                          (QREFELT $ 80))
                                . #4#)
                          (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 76))
                                . #4#)
                          (EXIT
                           (COND
                            ((SPADCALL |coef| (|spadConstant| $ 77)
                                       (QREFELT $ 78))
                             (|error|
                              "log of series with many leading zero coefficients")))))))))
                     (COND
                      ((SPADCALL |n| (QREFELT $ 96))
                       (COND
                        (|posCheck?|
                         (SEQ
                          (LETT |signum| (SPADCALL |coef| (QREFELT $ 99))
                                . #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 #5=#:G913))
                                      . #4#)
                                (GO #6=#:G912))))))))))))
                     (LETT |ans| (SPADCALL |ups| |n| (QREFELT $ 102)) . #4#)
                     (EXIT
                      (COND
                       ((QEQCAR |ans| 1)
                        (|FS2EXPXP;stateSeriesProblem| "nth root" "no nth root"
                         $))
                       (#3# (CONS 0 (QCDR |ans|)))))))
                   #6# (EXIT #1#)))))
          #5# (EXIT #2#)))) 

(SDEFUN |FS2EXPXP;nthRootXXPIfCan|
        ((|xxp| |ExponentialExpansion| R FE |x| |cen|)
         (|n| |NonNegativeInteger|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|newDen|
           #1=(|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                   |cen|))
          (|deg| (|ExponentialOfUnivariatePuiseuxSeries| FE |x| |cen|))
          (|coef| (|UnivariatePuiseuxSeries| FE |x| |cen|)) (#2=#:G921 NIL)
          (#3=#:G929 NIL) (#4=#:G922 NIL)
          (|root|
           (|Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|newNum| #1#) (|nInv| (|Fraction| (|Integer|)))
          (|den|
           (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                |cen|))
          (|num|
           (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                |cen|)))
         (SEQ
          (EXIT
           (SEQ
            (LETT |num| (SPADCALL |xxp| (QREFELT $ 85))
                  . #5=(|FS2EXPXP;nthRootXXPIfCan|))
            (LETT |den| (SPADCALL |xxp| (QREFELT $ 92)) . #5#)
            (COND
             ((SPADCALL (SPADCALL |num| (QREFELT $ 103)) (QREFELT $ 104))
              (COND
               ((NULL
                 (SPADCALL (SPADCALL |den| (QREFELT $ 103)) (QREFELT $ 104)))
                (EXIT
                 (|FS2EXPXP;stateProblem| #6="nth root"
                  #7="several monomials in numerator or denominator" $)))))
             (#8='T (EXIT (|FS2EXPXP;stateProblem| #6# #7# $))))
            (LETT |nInv| (SPADCALL 1 |n| (QREFELT $ 13)) . #5#)
            (LETT |newNum|
                  (SEQ
                   (LETT |coef|
                         (SEQ
                          (LETT |root|
                                (|FS2EXPXP;carefulNthRootIfCan|
                                 (SPADCALL |num| (QREFELT $ 89)) |n|
                                 |posCheck?| $)
                                . #5#)
                          (EXIT
                           (COND
                            ((QEQCAR |root| 1)
                             (PROGN
                              (LETT #3# (CONS 1 (CDR |root|)) . #5#)
                              (GO #9=#:G928)))
                            (#8# (CDR |root|)))))
                         . #5#)
                   (LETT |deg|
                         (SPADCALL (SPADCALL |nInv| (QREFELT $ 105))
                                   (SPADCALL |num| (QREFELT $ 107))
                                   (QREFELT $ 108))
                         . #5#)
                   (EXIT (SPADCALL |coef| |deg| (QREFELT $ 109))))
                  . #5#)
            (LETT |newDen|
                  (SEQ
                   (LETT |coef|
                         (SEQ
                          (LETT |root|
                                (|FS2EXPXP;carefulNthRootIfCan|
                                 (SPADCALL |den| (QREFELT $ 89)) |n|
                                 |posCheck?| $)
                                . #5#)
                          (EXIT
                           (COND
                            ((QEQCAR |root| 1)
                             (PROGN
                              (LETT #3#
                                    (CONS 1
                                          (PROG2 (LETT #4# |root| . #5#)
                                              (QCDR #4#)
                                            (|check_union2| (QEQCAR #4# 1)
                                                            (|Record|
                                                             (|:| |func|
                                                                  (|String|))
                                                             (|:| |prob|
                                                                  (|String|)))
                                                            (|Union|
                                                             (|:| |%series|
                                                                  (|UnivariatePuiseuxSeries|
                                                                   (QREFELT $
                                                                            7)
                                                                   (QREFELT $
                                                                            8)
                                                                   (QREFELT $
                                                                            9)))
                                                             (|:| |%problem|
                                                                  (|Record|
                                                                   (|:| |func|
                                                                        (|String|))
                                                                   (|:| |prob|
                                                                        (|String|)))))
                                                            #4#)))
                                    . #5#)
                              (GO #9#)))
                            (#8#
                             (PROG2 (LETT #2# |root| . #5#)
                                 (QCDR #2#)
                               (|check_union2| (QEQCAR #2# 0)
                                               (|UnivariatePuiseuxSeries|
                                                (QREFELT $ 7) (QREFELT $ 8)
                                                (QREFELT $ 9))
                                               (|Union|
                                                (|:| |%series|
                                                     (|UnivariatePuiseuxSeries|
                                                      (QREFELT $ 7)
                                                      (QREFELT $ 8)
                                                      (QREFELT $ 9)))
                                                (|:| |%problem|
                                                     (|Record|
                                                      (|:| |func| (|String|))
                                                      (|:| |prob|
                                                           (|String|)))))
                                               #2#))))))
                         . #5#)
                   (LETT |deg|
                         (SPADCALL (SPADCALL |nInv| (QREFELT $ 105))
                                   (SPADCALL |den| (QREFELT $ 107))
                                   (QREFELT $ 108))
                         . #5#)
                   (EXIT (SPADCALL |coef| |deg| (QREFELT $ 109))))
                  . #5#)
            (EXIT (CONS 0 (SPADCALL |newNum| |newDen| (QREFELT $ 110))))))
          #9# (EXIT #3#)))) 

(SDEFUN |FS2EXPXP;nthRootToXXP|
        ((|arg| FE) (|n| |NonNegativeInteger|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|ans|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|result|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (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|)))))))))))) 

(SDEFUN |FS2EXPXP;genPowerToXXP|
        ((|args| |List| FE) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|f| (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed"))
          (|xxp| (|ExponentialExpansion| R FE |x| |cen|))
          (|expon|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|logBase|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (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 $ 111)) |posCheck?| $)
                         . #1#)
                   (EXIT
                    (COND ((QEQCAR |expon| 1) |expon|)
                          (#2#
                           (SEQ
                            (LETT |xxp|
                                  (SPADCALL (CDR |expon|) (CDR |logBase|)
                                            (QREFELT $ 69))
                                  . #1#)
                            (LETT |f| (SPADCALL |xxp| (QREFELT $ 112)) . #1#)
                            (EXIT
                             (COND
                              ((QEQCAR |f| 1)
                               (|FS2EXPXP;stateProblem| "exp"
                                "multiply nested exponential" $))
                              (#2#
                               (|FS2EXPXP;exponential| (QCDR |f|) |posCheck?|
                                $))))))))))))))) 

(SDEFUN |FS2EXPXP;kernelToXXP|
        ((|ker| |Kernel| FE) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((#1=#:G965 NIL) (|n| (|Integer|)) (|arg| (FE)) (|args| (|List| FE))
          (|sym| (|Union| (|Symbol|) "failed")))
         (SEQ
          (LETT |sym| (SPADCALL |ker| (QREFELT $ 114))
                . #2=(|FS2EXPXP;kernelToXXP|))
          (EXIT
           (COND
            ((QEQCAR |sym| 0)
             (COND
              ((EQUAL (QCDR |sym|) (QREFELT $ 8))
               (CONS 0
                     (SPADCALL
                      (SPADCALL (|spadConstant| $ 10) (|spadConstant| $ 115)
                                (QREFELT $ 116))
                      (QREFELT $ 62))))
              (#3='T
               (CONS 0
                     (SPADCALL
                      (SPADCALL (SPADCALL |ker| (QREFELT $ 31))
                                (|spadConstant| $ 117) (QREFELT $ 116))
                      (QREFELT $ 62))))))
            ((NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 29)) . #2#))
             (CONS 0
                   (SPADCALL
                    (SPADCALL (SPADCALL |ker| (QREFELT $ 31))
                              (|spadConstant| $ 117) (QREFELT $ 116))
                    (QREFELT $ 62))))
            ((NULL (CDR |args|))
             (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
                  (EXIT
                   (COND
                    ((SPADCALL |ker| '|%paren| (QREFELT $ 38))
                     (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $))
                    ((SPADCALL |ker| '|log| (QREFELT $ 38))
                     (|FS2EXPXP;logToXXP| |arg| |posCheck?| $))
                    ((SPADCALL |ker| '|exp| (QREFELT $ 38))
                     (|FS2EXPXP;expToXXP| |arg| |posCheck?| $))
                    (#3# (|FS2EXPXP;tranToXXP| |ker| |arg| |posCheck?| $))))))
            ((SPADCALL |ker| '|%power| (QREFELT $ 38))
             (|FS2EXPXP;genPowerToXXP| |args| |posCheck?| $))
            ((SPADCALL |ker| '|nthRoot| (QREFELT $ 38))
             (SEQ
              (LETT |n|
                    (SPADCALL (SPADCALL |args| (QREFELT $ 111))
                              (QREFELT $ 118))
                    . #2#)
              (EXIT
               (|FS2EXPXP;nthRootToXXP| (|SPADfirst| |args|)
                (PROG1 (LETT #1# |n| . #2#)
                  (|check_subtype2| (>= #1# 0) '(|NonNegativeInteger|)
                                    '(|Integer|) #1#))
                |posCheck?| $))))
            (#3#
             (|FS2EXPXP;stateProblem|
              (SPADCALL (SPADCALL |ker| (QREFELT $ 119)) (QREFELT $ 121))
              "unknown kernel" $))))))) 

(SDEFUN |FS2EXPXP;genExp|
        ((|ups| |UnivariatePuiseuxSeries| FE |x| |cen|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|result|
           (|Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|expCoef| (FE)) (|varOpList| (|List| (|BasicOperator|))) (|lc| (FE))
          (|deg| (|Fraction| (|Integer|))))
         (SEQ
          (LETT |deg| (SPADCALL |ups| (|spadConstant| $ 115) (QREFELT $ 80))
                . #1=(|FS2EXPXP;genExp|))
          (EXIT
           (COND
            ((SPADCALL |deg| (|spadConstant| $ 117) (QREFELT $ 122))
             (|error| "exp of function with sigularity"))
            ((SPADCALL |deg| (|spadConstant| $ 117) (QREFELT $ 123))
             (CONS 0 (SPADCALL |ups| (QREFELT $ 124))))
            (#2='T
             (SEQ
              (LETT |lc| (SPADCALL |ups| (|spadConstant| $ 117) (QREFELT $ 76))
                    . #1#)
              (LETT |varOpList| (|FS2EXPXP;opsInvolvingX| |lc| $) . #1#)
              (COND
               ((NULL (|FS2EXPXP;opInOpList?| '|log| |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?| (CONS 3 "real: right side")
                              (QREFELT $ 127))
                    . #1#)
              (EXIT
               (COND ((QEQCAR |result| 1) |result|)
                     (#2#
                      (CONS 0
                            (SPADCALL (CDR |result|)
                                      (SPADCALL
                                       (SPADCALL |ups|
                                                 (SPADCALL |lc|
                                                           (|spadConstant| $
                                                                           117)
                                                           (QREFELT $ 116))
                                                 (QREFELT $ 128))
                                       (QREFELT $ 124))
                                      (QREFELT $ 129))))))))))))) 

(SDEFUN |FS2EXPXP;exponential|
        ((|f| |UnivariatePuiseuxSeries| FE |x| |cen|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|coef|
           (|Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|expon| (|ExponentialOfUnivariatePuiseuxSeries| FE |x| |cen|))
          (|taylorPart| #1=(|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|singPart| #1#))
         (SEQ
          (LETT |singPart|
                (SPADCALL (SPADCALL |f| (|spadConstant| $ 117) (QREFELT $ 130))
                          (SPADCALL
                           (SPADCALL |f| (|spadConstant| $ 117) (QREFELT $ 76))
                           (QREFELT $ 131))
                          (QREFELT $ 128))
                . #2=(|FS2EXPXP;exponential|))
          (LETT |taylorPart| (SPADCALL |f| |singPart| (QREFELT $ 128)) . #2#)
          (LETT |expon| (SPADCALL |singPart| (QREFELT $ 132)) . #2#)
          (LETT |coef| (|FS2EXPXP;genExp| |taylorPart| |posCheck?| $) . #2#)
          (EXIT
           (COND ((QEQCAR |coef| 1) (CONS 1 (CDR |coef|)))
                 ('T
                  (CONS 0
                        (SPADCALL
                         (SPADCALL (CDR |coef|) |expon| (QREFELT $ 109))
                         (QREFELT $ 95))))))))) 

(SDEFUN |FS2EXPXP;expToXXP|
        ((|arg| FE) (|posCheck?| |Boolean|)
         ($ |Union|
          (|:| |%expansion| #1=(|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|f| (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed"))
          (|xxp| #1#) (#2=#:G994 NIL)
          (|result|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (LETT |result| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
                . #3=(|FS2EXPXP;expToXXP|))
          (EXIT
           (COND ((QEQCAR |result| 1) |result|)
                 (#4='T
                  (SEQ
                   (LETT |xxp|
                         (PROG2 (LETT #2# |result| . #3#)
                             (QCDR #2#)
                           (|check_union2| (QEQCAR #2# 0)
                                           (|ExponentialExpansion|
                                            (QREFELT $ 6) (QREFELT $ 7)
                                            (QREFELT $ 8) (QREFELT $ 9))
                                           (|Union|
                                            (|:| |%expansion|
                                                 (|ExponentialExpansion|
                                                  (QREFELT $ 6) (QREFELT $ 7)
                                                  (QREFELT $ 8) (QREFELT $ 9)))
                                            (|:| |%problem|
                                                 (|Record|
                                                  (|:| |func| (|String|))
                                                  (|:| |prob| (|String|)))))
                                           #2#))
                         . #3#)
                   (LETT |f| (SPADCALL |xxp| (QREFELT $ 112)) . #3#)
                   (EXIT
                    (COND
                     ((QEQCAR |f| 1)
                      (|FS2EXPXP;stateProblem| "exp"
                       "multiply nested exponential" $))
                     (#4#
                      (|FS2EXPXP;exponential| (QCDR |f|) |posCheck?|
                       $))))))))))) 

(SDEFUN |FS2EXPXP;genLog|
        ((|ups| |UnivariatePuiseuxSeries| FE |x| |cen|) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|logTerm| (FE)) (|term1| (FE)) (|pow| (FE)) (|mon| (FE))
          (|negRat?| (|Boolean|))
          (|rat| (|Union| (|Fraction| (|Integer|)) "failed"))
          (|lt| (|UnivariatePuiseuxSeries| FE |x| |cen|)) (#1=#:G1020 NIL)
          (#2=#:G1021 NIL) (|signum| (|Union| (|Integer|) "failed"))
          (|coef| (FE)) (|deg| (|Fraction| (|Integer|))))
         (SEQ
          (EXIT
           (SEQ
            (EXIT
             (SEQ
              (LETT |deg| (SPADCALL |ups| (QREFELT $ 75))
                    . #3=(|FS2EXPXP;genLog|))
              (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 76)) . #3#)
                   (EXIT
                    (COND
                     ((SPADCALL |coef| (|spadConstant| $ 77) (QREFELT $ 78))
                      (SEQ
                       (LETT |deg|
                             (SPADCALL |ups|
                                       (SPADCALL |deg| (QREFELT $ 14)
                                                 (QREFELT $ 79))
                                       (QREFELT $ 80))
                             . #3#)
                       (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 76))
                             . #3#)
                       (EXIT
                        (COND
                         ((SPADCALL |coef| (|spadConstant| $ 77)
                                    (QREFELT $ 78))
                          (|error|
                           "log of series with many leading zero coefficients")))))))))
              (COND
               (|posCheck?|
                (SEQ (LETT |signum| (SPADCALL |coef| (QREFELT $ 99)) . #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 #4=#:G1019))
                                 . #3#)
                           (GO #5=#:G1018))))))))))
              (LETT |lt| (SPADCALL |coef| |deg| (QREFELT $ 116)) . #3#)
              (LETT |negRat?|
                    (SEQ (LETT |rat| (|FS2EXPXP;ratIfCan| |coef| $) . #3#)
                         (EXIT
                          (COND
                           ((QEQCAR |rat| 0)
                            (COND
                             ((SPADCALL (QCDR |rat|) (|spadConstant| $ 117)
                                        (QREFELT $ 122))
                              'T)
                             (#6='T NIL)))
                           (#6# NIL))))
                    . #3#)
              (LETT |logTerm|
                    (SEQ
                     (LETT |mon|
                           (SPADCALL (SPADCALL (QREFELT $ 8) (QREFELT $ 133))
                                     (QREFELT $ 9) (QREFELT $ 39))
                           . #3#)
                     (LETT |pow|
                           (SPADCALL |mon| (SPADCALL |deg| (QREFELT $ 105))
                                     (QREFELT $ 134))
                           . #3#)
                     (EXIT
                      (COND
                       (|negRat?|
                        (SPADCALL (SPADCALL |coef| |pow| (QREFELT $ 135))
                                  (QREFELT $ 46)))
                       (#6#
                        (SEQ
                         (LETT |term1|
                               (SPADCALL (SPADCALL |deg| (QREFELT $ 105))
                                         (SPADCALL |mon| (QREFELT $ 46))
                                         (QREFELT $ 135))
                               . #3#)
                         (EXIT
                          (SPADCALL (SPADCALL |coef| (QREFELT $ 46)) |term1|
                                    (QREFELT $ 41))))))))
                    . #3#)
              (EXIT
               (CONS 0
                     (SPADCALL
                      (SPADCALL |logTerm| (|spadConstant| $ 117)
                                (QREFELT $ 116))
                      (SPADCALL (SPADCALL |ups| |lt| (QREFELT $ 136))
                                (QREFELT $ 137))
                      (QREFELT $ 138))))))
            #5# (EXIT #1#)))
          #4# (EXIT #2#)))) 

(SDEFUN |FS2EXPXP;logToXXP|
        ((|arg| FE) (|posCheck?| |Boolean|)
         ($ |Union|
          (|:| |%expansion| #1=(|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|denLog| #2=(|UnivariatePuiseuxSeries| FE |x| |cen|)) (|numLog| #2#)
          (|denCoefLog| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (#3=#:G1027 NIL) (#4=#:G1034 NIL) (#5=#:G1028 NIL)
          (|res|
           (|Union| (|:| |%series| (|UnivariatePuiseuxSeries| FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|))))))
          (|numCoefLog| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|den|
           (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                |cen|))
          (|num|
           (|UnivariatePuiseuxSeriesWithExponentialSingularity| R FE |x|
                                                                |cen|))
          (|xxp| #1#) (#6=#:G1023 NIL)
          (|result|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (EXIT
           (SEQ
            (LETT |result| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
                  . #7=(|FS2EXPXP;logToXXP|))
            (EXIT
             (COND ((QEQCAR |result| 1) |result|)
                   (#8='T
                    (SEQ
                     (LETT |xxp|
                           (PROG2 (LETT #6# |result| . #7#)
                               (QCDR #6#)
                             (|check_union2| (QEQCAR #6# 0)
                                             (|ExponentialExpansion|
                                              (QREFELT $ 6) (QREFELT $ 7)
                                              (QREFELT $ 8) (QREFELT $ 9))
                                             (|Union|
                                              (|:| |%expansion|
                                                   (|ExponentialExpansion|
                                                    (QREFELT $ 6) (QREFELT $ 7)
                                                    (QREFELT $ 8)
                                                    (QREFELT $ 9)))
                                              (|:| |%problem|
                                                   (|Record|
                                                    (|:| |func| (|String|))
                                                    (|:| |prob| (|String|)))))
                                             #6#))
                           . #7#)
                     (LETT |num| (SPADCALL |xxp| (QREFELT $ 85)) . #7#)
                     (LETT |den| (SPADCALL |xxp| (QREFELT $ 92)) . #7#)
                     (COND
                      ((SPADCALL (SPADCALL |num| (QREFELT $ 103))
                                 (QREFELT $ 104))
                       (COND
                        ((NULL
                          (SPADCALL (SPADCALL |den| (QREFELT $ 103))
                                    (QREFELT $ 104)))
                         (EXIT
                          (|FS2EXPXP;stateProblem| #9="log"
                           #10="several monomials in numerator or denominator"
                           $)))))
                      (#8# (EXIT (|FS2EXPXP;stateProblem| #9# #10# $))))
                     (LETT |numCoefLog|
                           (SEQ
                            (LETT |res|
                                  (|FS2EXPXP;genLog|
                                   (SPADCALL |num| (QREFELT $ 89)) |posCheck?|
                                   $)
                                  . #7#)
                            (EXIT
                             (COND
                              ((QEQCAR |res| 1)
                               (PROGN
                                (LETT #4# (CONS 1 (CDR |res|)) . #7#)
                                (GO #11=#:G1033)))
                              (#8# (CDR |res|)))))
                           . #7#)
                     (LETT |denCoefLog|
                           (SEQ
                            (LETT |res|
                                  (|FS2EXPXP;genLog|
                                   (SPADCALL |den| (QREFELT $ 89)) |posCheck?|
                                   $)
                                  . #7#)
                            (EXIT
                             (COND
                              ((QEQCAR |res| 1)
                               (PROGN
                                (LETT #4#
                                      (CONS 1
                                            (PROG2 (LETT #5# |res| . #7#)
                                                (QCDR #5#)
                                              (|check_union2| (QEQCAR #5# 1)
                                                              (|Record|
                                                               (|:| |func|
                                                                    (|String|))
                                                               (|:| |prob|
                                                                    (|String|)))
                                                              (|Union|
                                                               (|:| |%series|
                                                                    (|UnivariatePuiseuxSeries|
                                                                     (QREFELT $
                                                                              7)
                                                                     (QREFELT $
                                                                              8)
                                                                     (QREFELT $
                                                                              9)))
                                                               (|:| |%problem|
                                                                    (|Record|
                                                                     (|:|
                                                                      |func|
                                                                      (|String|))
                                                                     (|:|
                                                                      |prob|
                                                                      (|String|)))))
                                                              #5#)))
                                      . #7#)
                                (GO #11#)))
                              (#8#
                               (PROG2 (LETT #3# |res| . #7#)
                                   (QCDR #3#)
                                 (|check_union2| (QEQCAR #3# 0)
                                                 (|UnivariatePuiseuxSeries|
                                                  (QREFELT $ 7) (QREFELT $ 8)
                                                  (QREFELT $ 9))
                                                 (|Union|
                                                  (|:| |%series|
                                                       (|UnivariatePuiseuxSeries|
                                                        (QREFELT $ 7)
                                                        (QREFELT $ 8)
                                                        (QREFELT $ 9)))
                                                  (|:| |%problem|
                                                       (|Record|
                                                        (|:| |func| (|String|))
                                                        (|:| |prob|
                                                             (|String|)))))
                                                 #3#))))))
                           . #7#)
                     (LETT |numLog|
                           (SPADCALL
                            (SPADCALL (SPADCALL |num| (QREFELT $ 107))
                                      (QREFELT $ 139))
                            |numCoefLog| (QREFELT $ 138))
                           . #7#)
                     (LETT |denLog|
                           (SPADCALL
                            (SPADCALL (SPADCALL |den| (QREFELT $ 107))
                                      (QREFELT $ 139))
                            |denCoefLog| (QREFELT $ 138))
                           . #7#)
                     (EXIT
                      (CONS 0
                            (SPADCALL
                             (SPADCALL |numLog| |denLog| (QREFELT $ 128))
                             (QREFELT $ 62))))))))))
          #11# (EXIT #4#)))) 

(SDEFUN |FS2EXPXP;applyIfCan|
        ((|fcn| |Mapping|
          (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed")
          (|UnivariatePuiseuxSeries| FE |x| |cen|))
         (|arg| FE) (|fcnName| |String|) (|posCheck?| |Boolean|)
         ($ |Union|
          (|:| |%expansion| #1=(|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((#2=#:G1039 NIL) (|xOpList| (|List| (|BasicOperator|))) (|lc| (FE))
          (|deg| (|Fraction| (|Integer|)))
          (|upxs| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|f| (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed"))
          (|xxp| #1#) (#3=#:G1036 NIL)
          (|xxpArg|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (LETT |xxpArg| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
                . #4=(|FS2EXPXP;applyIfCan|))
          (EXIT
           (COND ((QEQCAR |xxpArg| 1) |xxpArg|)
                 (#5='T
                  (SEQ
                   (LETT |xxp|
                         (PROG2 (LETT #3# |xxpArg| . #4#)
                             (QCDR #3#)
                           (|check_union2| (QEQCAR #3# 0)
                                           (|ExponentialExpansion|
                                            (QREFELT $ 6) (QREFELT $ 7)
                                            (QREFELT $ 8) (QREFELT $ 9))
                                           (|Union|
                                            (|:| |%expansion|
                                                 (|ExponentialExpansion|
                                                  (QREFELT $ 6) (QREFELT $ 7)
                                                  (QREFELT $ 8) (QREFELT $ 9)))
                                            (|:| |%problem|
                                                 (|Record|
                                                  (|:| |func| (|String|))
                                                  (|:| |prob| (|String|)))))
                                           #3#))
                         . #4#)
                   (LETT |f| (SPADCALL |xxp| (QREFELT $ 112)) . #4#)
                   (EXIT
                    (COND
                     ((QEQCAR |f| 1)
                      (|FS2EXPXP;stateProblem| |fcnName|
                       "multiply nested exponential" $))
                     (#5#
                      (SEQ (LETT |upxs| (QCDR |f|) . #4#)
                           (LETT |deg|
                                 (SPADCALL |upxs| (|spadConstant| $ 115)
                                           (QREFELT $ 80))
                                 . #4#)
                           (EXIT
                            (COND
                             ((SPADCALL |deg| (|spadConstant| $ 117)
                                        (QREFELT $ 122))
                              (|FS2EXPXP;stateProblem| |fcnName|
                               "essential singularity" $))
                             ((SPADCALL |deg| (|spadConstant| $ 117)
                                        (QREFELT $ 123))
                              (CONS 0
                                    (SPADCALL
                                     (PROG2
                                         (LETT #2# (SPADCALL |upxs| |fcn|)
                                               . #4#)
                                         (QCDR #2#)
                                       (|check_union2| (QEQCAR #2# 0)
                                                       (|UnivariatePuiseuxSeries|
                                                        (QREFELT $ 7)
                                                        (QREFELT $ 8)
                                                        (QREFELT $ 9))
                                                       (|Union|
                                                        (|UnivariatePuiseuxSeries|
                                                         (QREFELT $ 7)
                                                         (QREFELT $ 8)
                                                         (QREFELT $ 9))
                                                        #6="failed")
                                                       #2#))
                                     (QREFELT $ 62))))
                             (#5#
                              (SEQ
                               (LETT |lc|
                                     (SPADCALL |upxs| (|spadConstant| $ 117)
                                               (QREFELT $ 76))
                                     . #4#)
                               (LETT |xOpList|
                                     (|FS2EXPXP;opsInvolvingX| |lc| $) . #4#)
                               (EXIT
                                (COND
                                 ((NULL |xOpList|)
                                  (CONS 0
                                        (SPADCALL
                                         (PROG2
                                             (LETT #2# (SPADCALL |upxs| |fcn|)
                                                   . #4#)
                                             (QCDR #2#)
                                           (|check_union2| (QEQCAR #2# 0)
                                                           (|UnivariatePuiseuxSeries|
                                                            (QREFELT $ 7)
                                                            (QREFELT $ 8)
                                                            (QREFELT $ 9))
                                                           (|Union|
                                                            (|UnivariatePuiseuxSeries|
                                                             (QREFELT $ 7)
                                                             (QREFELT $ 8)
                                                             (QREFELT $ 9))
                                                            #6#)
                                                           #2#))
                                         (QREFELT $ 62))))
                                 ((|FS2EXPXP;opInOpList?| '|log| |xOpList| $)
                                  (|FS2EXPXP;stateProblem| |fcnName|
                                   "logs in constant coefficient" $))
                                 ((|FS2EXPXP;contOnReals?| |fcnName| $)
                                  (CONS 0
                                        (SPADCALL
                                         (PROG2
                                             (LETT #2# (SPADCALL |upxs| |fcn|)
                                                   . #4#)
                                             (QCDR #2#)
                                           (|check_union2| (QEQCAR #2# 0)
                                                           (|UnivariatePuiseuxSeries|
                                                            (QREFELT $ 7)
                                                            (QREFELT $ 8)
                                                            (QREFELT $ 9))
                                                           (|Union|
                                                            (|UnivariatePuiseuxSeries|
                                                             (QREFELT $ 7)
                                                             (QREFELT $ 8)
                                                             (QREFELT $ 9))
                                                            #6#)
                                                           #2#))
                                         (QREFELT $ 62))))
                                 (#5#
                                  (|FS2EXPXP;stateProblem| |fcnName|
                                   "x in constant coefficient"
                                   $))))))))))))))))))) 

(SDEFUN |FS2EXPXP;applyBddIfCan|
        ((|fe| FE)
         (|fcn| |Mapping|
          #1=(|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed")
          (|UnivariatePuiseuxSeries| FE |x| |cen|))
         (|arg| FE) (|fcnName| |String|) (|posCheck?| |Boolean|)
         ($ |Union|
          (|:| |%expansion| #2=(|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               #3=(|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|ans| #1#)
          (|f| (|Union| (|UnivariatePuiseuxSeries| FE |x| |cen|) "failed"))
          (|xxp| #2#) (#4=#:G1049 NIL) (|trouble| #3#)
          (|xxpArg|
           (|Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
                    (|:| |%problem|
                         (|Record| (|:| |func| (|String|))
                                   (|:| |prob| (|String|)))))))
         (SEQ
          (LETT |xxpArg| (|FS2EXPXP;iExprToXXP| |arg| |posCheck?| $)
                . #5=(|FS2EXPXP;applyBddIfCan|))
          (EXIT
           (COND
            ((QEQCAR |xxpArg| 1)
             (SEQ (LETT |trouble| (CDR |xxpArg|) . #5#)
                  (EXIT
                   (COND
                    ((EQUAL (QCDR |trouble|) "essential singularity")
                     (CONS 0
                           (SPADCALL
                            (SPADCALL |fe| (|spadConstant| $ 117)
                                      (QREFELT $ 116))
                            (QREFELT $ 62))))
                    (#6='T |xxpArg|)))))
            (#6#
             (SEQ
              (LETT |xxp|
                    (PROG2 (LETT #4# |xxpArg| . #5#)
                        (QCDR #4#)
                      (|check_union2| (QEQCAR #4# 0)
                                      (|ExponentialExpansion| (QREFELT $ 6)
                                                              (QREFELT $ 7)
                                                              (QREFELT $ 8)
                                                              (QREFELT $ 9))
                                      (|Union|
                                       (|:| |%expansion|
                                            (|ExponentialExpansion|
                                             (QREFELT $ 6) (QREFELT $ 7)
                                             (QREFELT $ 8) (QREFELT $ 9)))
                                       (|:| |%problem|
                                            (|Record| (|:| |func| (|String|))
                                                      (|:| |prob|
                                                           (|String|)))))
                                      #4#))
                    . #5#)
              (LETT |f| (SPADCALL |xxp| (QREFELT $ 112)) . #5#)
              (EXIT
               (COND
                ((QEQCAR |f| 1)
                 (|FS2EXPXP;stateProblem| "exp" "multiply nested exponential"
                  $))
                (#6#
                 (SEQ (LETT |ans| (SPADCALL (QCDR |f|) |fcn|) . #5#)
                      (EXIT
                       (COND
                        ((QEQCAR |ans| 1)
                         (CONS 0
                               (SPADCALL
                                (SPADCALL |fe| (|spadConstant| $ 117)
                                          (QREFELT $ 116))
                                (QREFELT $ 62))))
                        (#6#
                         (CONS 0
                               (SPADCALL (QCDR |ans|)
                                         (QREFELT $ 62))))))))))))))))) 

(SDEFUN |FS2EXPXP;contOnReals?| ((|fcn| |String|) ($ |Boolean|))
        (SPADCALL |fcn| (QREFELT $ 140) (QREFELT $ 143))) 

(SDEFUN |FS2EXPXP;bddOnReals?| ((|fcn| |String|) ($ |Boolean|))
        (SPADCALL |fcn| (QREFELT $ 141) (QREFELT $ 143))) 

(SDEFUN |FS2EXPXP;opsInvolvingX| ((|fcn| FE) ($ |List| (|BasicOperator|)))
        (SPROG
         ((|opList| (|List| #1=(|BasicOperator|))) (|op| #1#) (#2=#:G1066 NIL)
          (|k| NIL) (#3=#:G1065 NIL))
         (SEQ
          (LETT |opList|
                (PROGN
                 (LETT #3# NIL . #4=(|FS2EXPXP;opsInvolvingX|))
                 (SEQ (LETT |k| NIL . #4#)
                      (LETT #2# (SPADCALL |fcn| (QREFELT $ 145)) . #4#) G190
                      (COND
                       ((OR (ATOM #2#) (PROGN (LETT |k| (CAR #2#) . #4#) NIL))
                        (GO G191)))
                      (SEQ
                       (EXIT
                        (COND
                         ((COND
                           ((SPADCALL
                             (LETT |op| (SPADCALL |k| (QREFELT $ 48)) . #4#)
                             (QREFELT $ 146))
                            (SPADCALL (QREFELT $ 8)
                                      (SPADCALL
                                       (|SPADfirst|
                                        (SPADCALL |k| (QREFELT $ 29)))
                                       (QREFELT $ 148))
                                      (QREFELT $ 149)))
                           ('T NIL))
                          (LETT #3# (CONS |op| #3#) . #4#)))))
                      (LETT #2# (CDR #2#) . #4#) (GO G190) G191
                      (EXIT (NREVERSE #3#))))
                . #4#)
          (EXIT (SPADCALL |opList| (QREFELT $ 151)))))) 

(SDEFUN |FS2EXPXP;opInOpList?|
        ((|name| |Symbol|) (|opList| |List| (|BasicOperator|)) ($ |Boolean|))
        (SPROG ((#1=#:G1071 NIL) (#2=#:G1072 NIL) (#3=#:G1073 NIL) (|op| NIL))
               (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 $ 81))
                             (PROGN
                              (LETT #1#
                                    (PROGN (LETT #2# 'T . #4#) (GO #5=#:G1070))
                                    . #4#)
                              (GO #6=#:G1068))))))
                         (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL)))
                   #6# (EXIT #1#))
                  (EXIT NIL)))
                #5# (EXIT #2#)))) 

(SDEFUN |FS2EXPXP;exponential?| ((|fcn| FE) ($ |Boolean|))
        (SPROG ((|ker| (|Union| (|Kernel| FE) "failed")))
               (SEQ
                (LETT |ker| (SPADCALL |fcn| (QREFELT $ 71))
                      |FS2EXPXP;exponential?|)
                (EXIT
                 (COND
                  ((QEQCAR |ker| 0)
                   (SPADCALL (QCDR |ker|) '|exp| (QREFELT $ 38)))
                  ('T NIL)))))) 

(SDEFUN |FS2EXPXP;productOfNonZeroes?| ((|fcn| FE) ($ |Boolean|))
        (SPROG
         ((#1=#:G1089 NIL) (#2=#:G1090 NIL) (#3=#:G1091 NIL) (|term| NIL)
          (|prod| (|Union| (|List| FE) "failed")))
         (SEQ
          (EXIT
           (COND ((|FS2EXPXP;exponential?| |fcn| $) 'T)
                 (#4='T
                  (SEQ
                   (LETT |prod| (SPADCALL |fcn| (QREFELT $ 67))
                         . #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 #6=#:G1088))
                                                . #5#)
                                          (GO #7=#:G1084))))))))
                                   (LETT #3# (CDR #3#) . #5#) (GO G190) G191
                                   (EXIT NIL)))
                             #7# (EXIT #1#))
                            (EXIT 'T)))))))))
          #6# (EXIT #2#)))) 

(SDEFUN |FS2EXPXP;tranToXXP|
        ((|ker| |Kernel| FE) (|arg| FE) (|posCheck?| |Boolean|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (COND
         ((SPADCALL |ker| '|sin| (QREFELT $ 38))
          (|FS2EXPXP;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 31)) (ELT $ 152)
           |arg| "sin" |posCheck?| $))
         ((SPADCALL |ker| '|cos| (QREFELT $ 38))
          (|FS2EXPXP;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 31)) (ELT $ 153)
           |arg| "cos" |posCheck?| $))
         ((SPADCALL |ker| '|asin| (QREFELT $ 38))
          (|FS2EXPXP;applyIfCan| (ELT $ 154) |arg| "asin" |posCheck?| $))
         ((SPADCALL |ker| '|acos| (QREFELT $ 38))
          (|FS2EXPXP;applyIfCan| (ELT $ 155) |arg| "acos" |posCheck?| $))
         ((SPADCALL |ker| '|atan| (QREFELT $ 38))
          (|FS2EXPXP;atancotToXXP| (SPADCALL |ker| (QREFELT $ 31)) |arg|
           |posCheck?| 1 $))
         ((SPADCALL |ker| '|acot| (QREFELT $ 38))
          (|FS2EXPXP;atancotToXXP| (SPADCALL |ker| (QREFELT $ 31)) |arg|
           |posCheck?| -1 $))
         ((SPADCALL |ker| '|asec| (QREFELT $ 38))
          (|FS2EXPXP;applyIfCan| (ELT $ 156) |arg| "asec" |posCheck?| $))
         ((SPADCALL |ker| '|acsc| (QREFELT $ 38))
          (|FS2EXPXP;applyIfCan| (ELT $ 157) |arg| "acsc" |posCheck?| $))
         ((SPADCALL |ker| '|asinh| (QREFELT $ 38))
          (|FS2EXPXP;applyIfCan| (ELT $ 158) |arg| "asinh" |posCheck?| $))
         ('T
          (|FS2EXPXP;stateProblem|
           (SPADCALL (SPADCALL |ker| (QREFELT $ 119)) (QREFELT $ 121))
           "unknown kernel" $)))) 

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

(SDEFUN |FS2EXPXP;localAbs;2FE;33| ((|fcn| FE) ($ FE))
        (SPADCALL (SPADCALL |fcn| |fcn| (QREFELT $ 135)) (QREFELT $ 45))) 

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

(SDEFUN |FS2EXPXP;atancotToXXP|
        ((|fe| FE) (|arg| FE) (|posCheck?| |Boolean|) (|plusMinus| |Integer|)
         ($ |Union| (|:| |%expansion| (|ExponentialExpansion| R FE |x| |cen|))
          (|:| |%problem|
               (|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))))
        (SPROG
         ((|cc| (FE)) (|n| (|Integer|)) (|posNegPi2| (FE))
          (|signum| (|Union| (|Integer|) "failed")) (|lc| (FE))
          (#1=#:G1147 NIL) (|rn| (|Union| (|Fraction| (|Integer|)) "failed"))
          (#2=#:G1146 NIL) (|yCoef| (FE))
          (|y| (|UnivariatePuiseuxSeries| FE |x| |cen|))
          (|ord| (|Fraction| (|Integer|))) (|coef| (FE))
          (|ups| #3=(|UnivariatePuiseuxSeries| FE |x| |cen|)) (#4=#:G1127 NIL)
          (|trouble|
           #5=(|Record| (|:| |func| (|String|)) (|:| |prob| (|String|))))
          (|result| (|Union| (|:| |%series| #3#) (|:| |%problem| #5#))))
         (SEQ
          (EXIT
           (SEQ (LETT |posCheck?| 'T . #6=(|FS2EXPXP;atancotToXXP|))
                (LETT |result|
                      (SPADCALL |arg| |posCheck?| (CONS 3 "real: right side")
                                (QREFELT $ 127))
                      . #6#)
                (EXIT
                 (COND
                  ((QEQCAR |result| 1)
                   (SEQ (LETT |trouble| (CDR |result|) . #6#)
                        (EXIT
                         (COND
                          ((EQUAL (QCDR |trouble|) "essential singularity")
                           (CONS 0
                                 (SPADCALL
                                  (SPADCALL |fe| (|spadConstant| $ 117)
                                            (QREFELT $ 116))
                                  (QREFELT $ 62))))
                          (#7='T (CONS 1 (CDR |result|)))))))
                  (#7#
                   (SEQ
                    (EXIT
                     (SEQ
                      (LETT |ups|
                            (PROG2 (LETT #4# |result| . #6#)
                                (QCDR #4#)
                              (|check_union2| (QEQCAR #4# 0)
                                              (|UnivariatePuiseuxSeries|
                                               (QREFELT $ 7) (QREFELT $ 8)
                                               (QREFELT $ 9))
                                              (|Union|
                                               (|:| |%series|
                                                    (|UnivariatePuiseuxSeries|
                                                     (QREFELT $ 7)
                                                     (QREFELT $ 8)
                                                     (QREFELT $ 9)))
                                               (|:| |%problem|
                                                    (|Record|
                                                     (|:| |func| (|String|))
                                                     (|:| |prob| (|String|)))))
                                              #4#))
                            . #6#)
                      (LETT |coef|
                            (SPADCALL |ups| (|spadConstant| $ 117)
                                      (QREFELT $ 76))
                            . #6#)
                      (SEQ
                       (LETT |ord|
                             (SPADCALL |ups| (|spadConstant| $ 117)
                                       (QREFELT $ 80))
                             . #6#)
                       (EXIT
                        (COND
                         ((SPADCALL |ord| (|spadConstant| $ 117)
                                    (QREFELT $ 161))
                          (COND
                           ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 135))
                                      (SPADCALL (|spadConstant| $ 10)
                                                (QREFELT $ 162))
                                      (QREFELT $ 78))
                            (PROGN
                             (LETT #2#
                                   (SEQ
                                    (LETT |y|
                                          (SPADCALL
                                           (SPADCALL |ups| (QREFELT $ 163))
                                           (SPADCALL (|spadConstant| $ 164)
                                                     (SPADCALL |ups| |ups|
                                                               (QREFELT $ 129))
                                                     (QREFELT $ 138))
                                           (QREFELT $ 136))
                                          . #6#)
                                    (LETT |yCoef|
                                          (SPADCALL |y|
                                                    (SPADCALL
                                                     (|spadConstant| $ 115)
                                                     (QREFELT $ 165))
                                                    (QREFELT $ 76))
                                          . #6#)
                                    (EXIT
                                     (CONS 0
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL
                                              (SPADCALL |yCoef| (QREFELT $ 46))
                                              (|spadConstant| $ 117)
                                              (QREFELT $ 116))
                                             (SPADCALL
                                              (SPADCALL |y|
                                                        (SPADCALL |yCoef|
                                                                  (SPADCALL
                                                                   (|spadConstant|
                                                                    $ 115)
                                                                   (QREFELT $
                                                                            165))
                                                                  (QREFELT $
                                                                           116))
                                                        (QREFELT $ 128))
                                              (QREFELT $ 166))
                                             (QREFELT $ 138))
                                            (QREFELT $ 62)))))
                                   . #6#)
                             (GO #8=#:G1143))))))))
                      (LETT |cc|
                            (COND
                             ((SPADCALL |ord| (|spadConstant| $ 117)
                                        (QREFELT $ 122))
                              (SEQ
                               (LETT |rn|
                                     (|FS2EXPXP;ratIfCan|
                                      (SPADCALL |ord| (QREFELT $ 105)) $)
                                     . #6#)
                               (EXIT
                                (COND
                                 ((QEQCAR |rn| 1)
                                  (PROGN
                                   (LETT #1#
                                         (|FS2EXPXP;stateProblem| "atan"
                                          "branch problem" $)
                                         . #6#)
                                   (GO #9=#:G1145)))
                                 (#7#
                                  (SEQ
                                   (LETT |lc|
                                         (SPADCALL |ups| |ord| (QREFELT $ 76))
                                         . #6#)
                                   (LETT |signum|
                                         (SPADCALL |lc| (QREFELT $ 99)) . #6#)
                                   (EXIT
                                    (COND
                                     ((QEQCAR |signum| 1)
                                      (SEQ
                                       (LETT |posNegPi2|
                                             (SPADCALL
                                              (SPADCALL
                                               (|FS2EXPXP;signOfExpression|
                                                |lc| $)
                                               (SPADCALL (QREFELT $ 167))
                                               (QREFELT $ 135))
                                              (SPADCALL 2 (QREFELT $ 40))
                                              (QREFELT $ 20))
                                             . #6#)
                                       (EXIT
                                        (COND ((EQL |plusMinus| 1) |posNegPi2|)
                                              (#7#
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL (QREFELT $ 167))
                                                 (SPADCALL 2 (QREFELT $ 40))
                                                 (QREFELT $ 20))
                                                |posNegPi2|
                                                (QREFELT $ 39)))))))
                                     ((EQL (LETT |n| (QCDR |signum|) . #6#) -1)
                                      (COND
                                       ((EQL |plusMinus| 1)
                                        (SPADCALL
                                         (SPADCALL (SPADCALL (QREFELT $ 167))
                                                   (SPADCALL 2 (QREFELT $ 40))
                                                   (QREFELT $ 20))
                                         (QREFELT $ 162)))
                                       (#7# (SPADCALL (QREFELT $ 167)))))
                                     ((EQL |plusMinus| 1)
                                      (SPADCALL (SPADCALL (QREFELT $ 167))
                                                (SPADCALL 2 (QREFELT $ 40))
                                                (QREFELT $ 20)))
                                     (#7# (|spadConstant| $ 77))))))))))
                             (#7# (SPADCALL |coef| (QREFELT $ 168))))
                            . #6#)
                      (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 $ 62))))))
                    #8# (EXIT #2#)))))))
          #9# (EXIT #1#)))) 

(DECLAIM (NOTINLINE |FunctionSpaceToExponentialExpansion;|)) 

(DEFUN |FunctionSpaceToExponentialExpansion| (&REST #1=#:G1148)
  (SPROG NIL
         (PROG (#2=#:G1149)
           (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|)
  (SPROG
   ((|pv$| NIL) ($ NIL) (|dv$| NIL) (DV$4 NIL) (DV$3 NIL) (DV$2 NIL)
    (DV$1 NIL))
   (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 169) . #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|)
    (SETF |pv$| (QREFELT $ 3))
    (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|) (|Boolean|) (|Symbol|) (73 . |is?|)
              (79 . -) (85 . |coerce|) (90 . +) (|PositiveInteger|) (96 . *)
              (102 . ^) (108 . |sqrt|) (113 . |log|) (|BasicOperator|)
              (118 . |operator|) (|List| $) (123 . |elt|)
              (|Record| (|:| |func| 120) (|:| |prob| 120))
              (|Union| (|:| |%expansion| 61) (|:| |%problem| 51))
              |FS2EXPXP;exprToXXP;FEBU;7| (|Union| (|Polynomial| 6) '#1#)
              (129 . |retractIfCan|)
              (|Union| (|:| |%series| 60) (|:| |%problem| 51))
              (|Union| '"complex" '"real: two sides" '"real: left side"
                       '"real: right side" '"just do it")
              (|FunctionSpaceToUnivariatePowerSeries| 6 7 12 60 101
                                                      (|UnivariateTaylorSeries|
                                                       7
                                                       (NRTEVAL (QREFELT $ 8))
                                                       (NRTEVAL (QREFELT $ 9)))
                                                      (|TaylorSeriesExpansionPuiseux|
                                                       7
                                                       (|UnivariateTaylorSeries|
                                                        7
                                                        (NRTEVAL (QREFELT $ 8))
                                                        (NRTEVAL
                                                         (QREFELT $ 9)))
                                                       (|UnivariateLaurentSeries|
                                                        7
                                                        (NRTEVAL (QREFELT $ 8))
                                                        (NRTEVAL
                                                         (QREFELT $ 9)))
                                                       60)
                                                      (NRTEVAL (QREFELT $ 8)))
              (134 . |exprToUPS|)
              (|UnivariatePuiseuxSeries| 7 (NRTEVAL (QREFELT $ 8))
                                         (NRTEVAL (QREFELT $ 9)))
              (|ExponentialExpansion| 6 7 (NRTEVAL (QREFELT $ 8))
                                      (NRTEVAL (QREFELT $ 9)))
              (141 . |coerce|) (|Union| 49 '#2="failed") (146 . |isPlus|)
              (151 . |Zero|) (155 . +) (161 . |isTimes|) (166 . |One|)
              (170 . *) (|Union| 30 '#1#) (176 . |retractIfCan|)
              (|Record| (|:| |val| $) (|:| |exponent| 11)) (|Union| 72 '#2#)
              (181 . |isPower|) (186 . |degree|) (191 . |coefficient|)
              (197 . |Zero|) (201 . =) (207 . +) (213 . |order|) (219 . |is?|)
              (225 . >) (231 . ^)
              (|UnivariatePuiseuxSeriesWithExponentialSingularity| 6 7
                                                                   (NRTEVAL
                                                                    (QREFELT $
                                                                             8))
                                                                   (NRTEVAL
                                                                    (QREFELT $
                                                                             9)))
              (237 . |numer|) (|NonNegativeInteger|)
              (242 . |numberOfMonomials|) (247 . >)
              (253 . |leadingCoefficient|) (|Union| $ '"failed")
              (258 . |recip|) (263 . |denom|) (268 . ^) (274 . *)
              (280 . |coerce|) (285 . |even?|) (|Union| 11 '"failed")
              (|ElementaryFunctionSign| 6 7) (290 . |sign|)
              (|Union| 60 '"failed")
              (|ElementaryFunctionsUnivariatePuiseuxSeries| 7
                                                            (|UnivariateLaurentSeries|
                                                             7
                                                             (NRTEVAL
                                                              (QREFELT $ 8))
                                                             (NRTEVAL
                                                              (QREFELT $ 9)))
                                                            60
                                                            (|ElementaryFunctionsUnivariateLaurentSeries|
                                                             7
                                                             (|UnivariateTaylorSeries|
                                                              7
                                                              (NRTEVAL
                                                               (QREFELT $ 8))
                                                              (NRTEVAL
                                                               (QREFELT $ 9)))
                                                             (|UnivariateLaurentSeries|
                                                              7
                                                              (NRTEVAL
                                                               (QREFELT $ 8))
                                                              (NRTEVAL
                                                               (QREFELT $
                                                                        9)))))
              (295 . |nthRootIfCan|) (301 . |reductum|) (306 . |zero?|)
              (311 . |coerce|)
              (|ExponentialOfUnivariatePuiseuxSeries| 7 (NRTEVAL (QREFELT $ 8))
                                                      (NRTEVAL (QREFELT $ 9)))
              (316 . |degree|) (321 . *) (327 . |monomial|) (333 . /)
              (339 . |second|) (344 . |retractIfCan|) (|Union| 37 '"failed")
              (349 . |symbolIfCan|) (354 . |One|) (358 . |monomial|)
              (364 . |Zero|) (368 . |retract|) (373 . |name|) (|String|)
              (378 . |string|) (383 . <) (389 . >) (395 . |exp|)
              (|ElementaryFunctionStructurePackage| 6 7) (400 . |normalize|)
              (406 . |exprToGenUPS|) (413 . -) (419 . *) (425 . |truncate|)
              (431 . |coerce|) (436 . |exponential|) (441 . |coerce|) (446 . ^)
              (452 . *) (458 . /) (464 . |log|) (469 . +) (475 . |exponent|)
              'CONTFCNS 'BDDFCNS (|List| 120) (480 . |member?|) (|List| 30)
              (486 . |tower|) (491 . |unary?|) (|List| 37) (496 . |variables|)
              (501 . |member?|) (|List| 47) (507 . |removeDuplicates|)
              (512 . |sinIfCan|) (517 . |cosIfCan|) (522 . |asinIfCan|)
              (527 . |acosIfCan|) (532 . |asecIfCan|) (537 . |acscIfCan|)
              (542 . |asinhIfCan|) (547 . |abs|) (552 . |localAbs|) (557 . =)
              (563 . -) (568 . |differentiate|) (573 . |One|) (577 . -)
              (582 . |integrate|) (587 . |pi|) (591 . |atan|))
           '#(|localAbs| 596 |exprToXXP| 601) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 168
                                                 '(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 2 28 36 0 37 38 2 7 0 0 0
                                                   39 1 7 0 11 40 2 7 0 0 0 41
                                                   2 7 0 42 0 43 2 7 0 0 42 44
                                                   1 7 0 0 45 1 7 0 0 46 1 28
                                                   47 0 48 2 7 0 47 49 50 1 7
                                                   54 0 55 3 58 56 7 36 57 59 1
                                                   61 0 60 62 1 7 63 0 64 0 61
                                                   0 65 2 61 0 0 0 66 1 7 63 0
                                                   67 0 61 0 68 2 61 0 0 0 69 1
                                                   7 70 0 71 1 7 73 0 74 1 60
                                                   12 0 75 2 60 7 0 12 76 0 7 0
                                                   77 2 7 36 0 0 78 2 12 0 0 0
                                                   79 2 60 12 0 12 80 2 47 36 0
                                                   37 81 2 11 36 0 0 82 2 61 0
                                                   0 11 83 1 61 84 0 85 1 84 86
                                                   0 87 2 86 36 0 0 88 1 84 60
                                                   0 89 1 84 90 0 91 1 61 84 0
                                                   92 2 84 0 0 86 93 2 84 0 0 0
                                                   94 1 61 0 84 95 1 11 36 0 96
                                                   1 98 97 7 99 2 101 100 60 86
                                                   102 1 84 0 0 103 1 84 36 0
                                                   104 1 7 0 12 105 1 84 106 0
                                                   107 2 106 0 7 0 108 2 84 0
                                                   60 106 109 2 61 0 84 84 110
                                                   1 27 7 0 111 1 61 100 0 112
                                                   1 28 113 0 114 0 12 0 115 2
                                                   60 0 7 12 116 0 12 0 117 1 7
                                                   11 0 118 1 28 37 0 119 1 37
                                                   120 0 121 2 12 36 0 0 122 2
                                                   12 36 0 0 123 1 101 60 60
                                                   124 2 125 7 7 37 126 3 58 56
                                                   7 36 57 127 2 60 0 0 0 128 2
                                                   60 0 0 0 129 2 60 0 0 12 130
                                                   1 60 0 7 131 1 106 0 60 132
                                                   1 7 0 37 133 2 7 0 0 0 134 2
                                                   7 0 0 0 135 2 60 0 0 0 136 1
                                                   101 60 60 137 2 60 0 0 0 138
                                                   1 106 60 0 139 2 142 36 120
                                                   0 143 1 7 144 0 145 1 47 36
                                                   0 146 1 7 147 0 148 2 147 36
                                                   37 0 149 1 150 0 0 151 1 101
                                                   100 60 152 1 101 100 60 153
                                                   1 101 100 60 154 1 101 100
                                                   60 155 1 101 100 60 156 1
                                                   101 100 60 157 1 101 100 60
                                                   158 1 7 0 0 159 1 0 7 7 160
                                                   2 12 36 0 0 161 1 7 0 0 162
                                                   1 60 0 0 163 0 60 0 164 1 12
                                                   0 0 165 1 60 0 0 166 0 7 0
                                                   167 1 7 0 0 168 1 0 7 7 160
                                                   2 0 52 7 36 53)))))
           '|lookupComplete|)) 
