
(/VERSIONCHECK 2) 

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

(DEFUN |FS2UPS;carefulNthRootIfCan| (|ups| |n| |posCheck?| |rightOnly?| $)
  (PROG (|ans| #1=#:G1945 |signum| |coef| |deg|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((< |n| 1) (|error| "nthRoot: n must be positive"))
             (#2='T
              (SEQ
               (LETT |deg| (SPADCALL |ups| (QREFELT $ 19))
                     . #3=(|FS2UPS;carefulNthRootIfCan|))
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20)) . #3#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 22) (QREFELT $ 24))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 14)
                                                            (QREFELT $ 26))
                                                  (QREFELT $ 27))
                                        (QREFELT $ 28))
                              . #3#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20))
                              . #3#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 22)
                                     (QREFELT $ 24))
                           (|error|
                            "log of series with many leading zero coefficients")))))))))
               (COND
                ((SPADCALL |n| (QREFELT $ 29))
                 (COND
                  (|posCheck?|
                   (SEQ (LETT |signum| (SPADCALL |coef| (QREFELT $ 32)) . #3#)
                        (EXIT
                         (COND
                          ((QEQCAR |signum| 0)
                           (COND
                            ((EQL (QCDR |signum|) -1)
                             (PROGN
                              (LETT #1#
                                    (|FS2UPS;stateProblem| "nth root"
                                     "negative leading coefficient" $)
                                    . #3#)
                              (GO #1#)))
                            ((NULL |rightOnly?|)
                             (COND
                              ((NULL (SPADCALL |deg| (QREFELT $ 33)))
                               (PROGN
                                (LETT #1#
                                      (|FS2UPS;stateProblem| "nth root"
                                       "series of non-zero order" $)
                                      . #3#)
                                (GO #1#))))))))))))))
               (LETT |ans| (SPADCALL |ups| |n| (QREFELT $ 36)) . #3#)
               (EXIT
                (COND
                 ((QEQCAR |ans| 1)
                  (|FS2UPS;stateProblem| "nth root" "no nth root" $))
                 (#2# (CONS 0 (QCDR |ans|)))))))))
      #1# (EXIT #1#))))) 

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

(DEFUN |FS2UPS;exprToUPS;FEBUU;4| (|fcn| |posCheck?| |atanFlag| $)
  (PROG (|ker| |power| |expt| |prod| |sum| |poly|)
    (RETURN
     (SEQ
      (LETT |poly| (SPADCALL |fcn| (QREFELT $ 38))
            . #1=(|FS2UPS;exprToUPS;FEBUU;4|))
      (EXIT
       (COND
        ((QEQCAR |poly| 0)
         (CONS 0
               (|FS2UPS;polyToUPS|
                (SPADCALL (QCDR |poly|) (QREFELT $ 13) (QREFELT $ 42)) $)))
        (#2='T
         (SEQ (LETT |sum| (SPADCALL |fcn| (QREFELT $ 44)) . #1#)
              (EXIT
               (COND
                ((QEQCAR |sum| 0)
                 (|FS2UPS;listToUPS| (QCDR |sum|) (ELT $ 48) |posCheck?|
                  |atanFlag| (|spadConstant| $ 49) (ELT $ 50) $))
                (#2#
                 (SEQ (LETT |prod| (SPADCALL |fcn| (QREFELT $ 51)) . #1#)
                      (EXIT
                       (COND
                        ((QEQCAR |prod| 0)
                         (|FS2UPS;listToUPS| (QCDR |prod|) (ELT $ 48)
                          |posCheck?| |atanFlag| (|spadConstant| $ 52)
                          (ELT $ 53) $))
                        (#2#
                         (SEQ
                          (LETT |expt| (|FS2UPS;isNonTrivPower| |fcn| $) . #1#)
                          (EXIT
                           (COND
                            ((QEQCAR |expt| 0)
                             (SEQ (LETT |power| (QCDR |expt|) . #1#)
                                  (EXIT
                                   (|FS2UPS;powerToUPS| (QCAR |power|)
                                    (QCDR |power|) |posCheck?| |atanFlag| $))))
                            (#2#
                             (SEQ
                              (LETT |ker| (SPADCALL |fcn| (QREFELT $ 55))
                                    . #1#)
                              (EXIT
                               (COND
                                ((QEQCAR |ker| 0)
                                 (|FS2UPS;kernelToUPS| (QCDR |ker|) |posCheck?|
                                  |atanFlag| $))
                                (#2#
                                 (|error|
                                  "exprToUPS: neither a sum, product, power, nor kernel")))))))))))))))))))))))) 

(DEFUN |FS2UPS;polyToUPS| (|poly| $)
  (PROG (|ans| |coef| |deg|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |poly| (QREFELT $ 57)) (|spadConstant| $ 49))
            ('T
             (SEQ
              (LETT |deg| (SPADCALL |poly| (QREFELT $ 58))
                    . #1=(|FS2UPS;polyToUPS|))
              (LETT |coef|
                    (SPADCALL (SPADCALL |poly| (QREFELT $ 59)) (QREFELT $ 60))
                    . #1#)
              (LETT |ans|
                    (SPADCALL |coef| (SPADCALL |deg| (QREFELT $ 26))
                              (QREFELT $ 61))
                    . #1#)
              (LETT |poly| (SPADCALL |poly| (QREFELT $ 62)) . #1#)
              (SEQ G190
                   (COND
                    ((NULL
                      (COND ((SPADCALL |poly| (QREFELT $ 57)) 'NIL) ('T 'T)))
                     (GO G191)))
                   (SEQ (LETT |deg| (SPADCALL |poly| (QREFELT $ 58)) . #1#)
                        (LETT |coef|
                              (SPADCALL (SPADCALL |poly| (QREFELT $ 59))
                                        (QREFELT $ 60))
                              . #1#)
                        (LETT |ans|
                              (SPADCALL |ans|
                                        (SPADCALL |coef|
                                                  (SPADCALL |deg|
                                                            (QREFELT $ 26))
                                                  (QREFELT $ 61))
                                        (QREFELT $ 50))
                              . #1#)
                        (EXIT
                         (LETT |poly| (SPADCALL |poly| (QREFELT $ 62)) . #1#)))
                   NIL (GO G190) G191 (EXIT NIL))
              (EXIT |ans|)))))))) 

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

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

(DEFUN |FS2UPS;powerToUPS| (|fcn| |n| |posCheck?| |atanFlag| $)
  (PROG (|coef| |deg| |ups| #1=#:G2043 |b|)
    (RETURN
     (SEQ
      (LETT |b| (SPADCALL |fcn| |posCheck?| |atanFlag| (QREFELT $ 48))
            . #2=(|FS2UPS;powerToUPS|))
      (EXIT
       (COND ((QEQCAR |b| 1) |b|)
             ((< 0 |n|) (CONS 0 (SPADCALL (CDR |b|) |n| (QREFELT $ 68))))
             ('T
              (SEQ
               (LETT |ups|
                     (PROG2
                         (LETT #1# |b| . #2#)
                         (QCDR #1#)
                       (|check-union| (QEQCAR #1# 0) (QREFELT $ 9) #1#))
                     . #2#)
               (LETT |deg| (SPADCALL |ups| (QREFELT $ 19)) . #2#)
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20)) . #2#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 22) (QREFELT $ 24))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 14)
                                                            (QREFELT $ 26))
                                                  (QREFELT $ 27))
                                        (QREFELT $ 28))
                              . #2#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20))
                              . #2#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 22)
                                     (QREFELT $ 24))
                           (|error|
                            "inverse of series with many leading zero coefficients")))))))))
               (EXIT (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 68)))))))))))) 

(DEFUN |FS2UPS;handleargs| (|args| |posCheck?| |atanFlag| $)
  (PROG (|lsers| |lsere| |lcoef| |losers| |coef| #1=#:G2076 |ups| #2=#:G2058
         |nsu| #3=#:G2077 |arg|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ (LETT |losers| NIL . #4=(|FS2UPS;handleargs|))
            (LETT |lsers| NIL . #4#) (LETT |lsere| NIL . #4#)
            (LETT |lcoef| NIL . #4#)
            (SEQ (LETT |arg| NIL . #4#) (LETT #3# |args| . #4#) G190
                 (COND
                  ((OR (ATOM #3#) (PROGN (LETT |arg| (CAR #3#) . #4#) NIL))
                   (GO G191)))
                 (SEQ
                  (EXIT
                   (COND
                    ((NULL
                      (SPADCALL (QREFELT $ 13) (SPADCALL |arg| (QREFELT $ 71))
                                (QREFELT $ 72)))
                     (SEQ
                      (LETT |losers|
                            (CONS (SPADCALL |arg| (QREFELT $ 73)) |losers|)
                            . #4#)
                      (LETT |lsers| (CONS (|spadConstant| $ 49) |lsers|) . #4#)
                      (LETT |lsere| (CONS (|spadConstant| $ 22) |lsere|) . #4#)
                      (EXIT (LETT |lcoef| (CONS |arg| |lcoef|) . #4#))))
                    ('T
                     (SEQ
                      (LETT |nsu|
                            (SPADCALL |arg| |posCheck?| |atanFlag|
                                      (QREFELT $ 48))
                            . #4#)
                      (EXIT
                       (COND
                        ((QEQCAR |nsu| 1)
                         (PROGN (LETT #1# (CONS 1 |nsu|) . #4#) (GO #1#)))
                        ('T
                         (SEQ
                          (LETT |ups|
                                (PROG2
                                    (LETT #2# |nsu| . #4#)
                                    (QCDR #2#)
                                  (|check-union| (QEQCAR #2# 0) (QREFELT $ 9)
                                                 #2#))
                                . #4#)
                          (EXIT
                           (COND
                            ((SPADCALL
                              (SPADCALL |ups| (|spadConstant| $ 66)
                                        (QREFELT $ 28))
                              (|spadConstant| $ 66) (QREFELT $ 74))
                             (PROGN
                              (LETT #1#
                                    (CONS 1
                                          (|FS2UPS;stateProblem| "handleargs"
                                           "argument not Taylor" $))
                                    . #4#)
                              (GO #1#)))
                            ('T
                             (SEQ
                              (LETT |coef|
                                    (SPADCALL |ups| (|spadConstant| $ 66)
                                              (QREFELT $ 20))
                                    . #4#)
                              (LETT |losers| (CONS |ups| |losers|) . #4#)
                              (LETT |lcoef| (CONS |coef| |lcoef|) . #4#)
                              (LETT |lsere|
                                    (CONS (|spadConstant| $ 18) |lsere|) . #4#)
                              (EXIT
                               (LETT |lsers|
                                     (CONS
                                      (SPADCALL |ups|
                                                (SPADCALL |coef|
                                                          (QREFELT $ 73))
                                                (QREFELT $ 75))
                                      |lsers|)
                                     . #4#)))))))))))))))
                 (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL))
            (EXIT
             (CONS 0
                   (VECTOR (NREVERSE |losers|) (NREVERSE |lsers|)
                           (NREVERSE |lsere|) (NREVERSE |lcoef|))))))
      #1# (EXIT #1#))))) 

(DEFUN |FS2UPS;dotaylorviaderiv| (|nf| |lsyms| |lser| $)
  (PROG (|ups| |lders| #1=#:G2093 |sym| #2=#:G2092)
    (RETURN
     (SEQ
      (LETT |lders|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;dotaylorviaderiv|))
             (SEQ (LETT |sym| NIL . #3#) (LETT #1# |lsyms| . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |sym| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT
                    (LETT #2#
                          (CONS
                           (CONS #'|FS2UPS;dotaylorviaderiv!0|
                                 (VECTOR $ |sym|))
                           #2#)
                          . #3#)))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (LETT |ups| (SPADCALL |nf| |lser| |lders| (QREFELT $ 80)) . #3#)
      (EXIT
       (CONS 0
             (SPADCALL (CONS #'|FS2UPS;dotaylorviaderiv!1| (VECTOR $ |lsyms|))
                       |ups| (QREFELT $ 86)))))))) 

(DEFUN |FS2UPS;dotaylorviaderiv!1| (|c| $$)
  (PROG (|lsyms| $)
    (LETT |lsyms| (QREFELT $$ 1) . #1=(|FS2UPS;dotaylorviaderiv|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (PROG (#2=#:G2089 |sym| #3=#:G2088)
        (RETURN
         (SEQ
          (SPADCALL |c|
                    (PROGN
                     (LETT #3# NIL NIL)
                     (SEQ (LETT |sym| NIL NIL) (LETT #2# |lsyms| NIL) G190
                          (COND
                           ((OR (ATOM #2#)
                                (PROGN (LETT |sym| (CAR #2#) NIL) NIL))
                            (GO G191)))
                          (SEQ
                           (EXIT
                            (LETT #3#
                                  (CONS
                                   (SPADCALL (SPADCALL |sym| (QREFELT $ 81))
                                             (|spadConstant| $ 22)
                                             (QREFELT $ 83))
                                   #3#)
                                  NIL)))
                          (LETT #2# (CDR #2#) NIL) (GO G190) G191
                          (EXIT (NREVERSE0 #3#))))
                    (QREFELT $ 85))))))))) 

(DEFUN |FS2UPS;dotaylorviaderiv!0| (|c| $$)
  (PROG (|sym| $)
    (LETT |sym| (QREFELT $$ 1) . #1=(|FS2UPS;dotaylorviaderiv|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN (PROGN (SPADCALL |c| |sym| (QREFELT $ 76)))))) 

(DEFUN |FS2UPS;dotaylorviaderiv2| (|nk| |lsyms| |lser| $)
  (PROG (|ups| |lders| #1=#:G2107 |sym| #2=#:G2106)
    (RETURN
     (SEQ
      (LETT |lders|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;dotaylorviaderiv2|))
             (SEQ (LETT |sym| NIL . #3#) (LETT #1# |lsyms| . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |sym| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT
                    (LETT #2#
                          (CONS
                           (CONS #'|FS2UPS;dotaylorviaderiv2!0|
                                 (VECTOR $ |sym|))
                           #2#)
                          . #3#)))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (LETT |ups| (SPADCALL |nk| |lser| |lders| (QREFELT $ 87)) . #3#)
      (EXIT
       (CONS 0
             (SPADCALL (CONS #'|FS2UPS;dotaylorviaderiv2!1| (VECTOR $ |lsyms|))
                       |ups| (QREFELT $ 86)))))))) 

(DEFUN |FS2UPS;dotaylorviaderiv2!1| (|c| $$)
  (PROG (|lsyms| $)
    (LETT |lsyms| (QREFELT $$ 1) . #1=(|FS2UPS;dotaylorviaderiv2|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (PROG (#2=#:G2103 |sym| #3=#:G2102)
        (RETURN
         (SEQ
          (SPADCALL |c|
                    (PROGN
                     (LETT #3# NIL NIL)
                     (SEQ (LETT |sym| NIL NIL) (LETT #2# |lsyms| NIL) G190
                          (COND
                           ((OR (ATOM #2#)
                                (PROGN (LETT |sym| (CAR #2#) NIL) NIL))
                            (GO G191)))
                          (SEQ
                           (EXIT
                            (LETT #3#
                                  (CONS
                                   (SPADCALL (SPADCALL |sym| (QREFELT $ 81))
                                             (|spadConstant| $ 22)
                                             (QREFELT $ 83))
                                   #3#)
                                  NIL)))
                          (LETT #2# (CDR #2#) NIL) (GO G190) G191
                          (EXIT (NREVERSE0 #3#))))
                    (QREFELT $ 85))))))))) 

(DEFUN |FS2UPS;dotaylorviaderiv2!0| (|c| $$)
  (PROG (|sym| $)
    (LETT |sym| (QREFELT $$ 1) . #1=(|FS2UPS;dotaylorviaderiv2|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN (PROGN (SPADCALL |c| |sym| (QREFELT $ 76)))))) 

(DEFUN |FS2UPS;convertargs| (|lsers| |lsere| |lser0| $)
  (PROG (|nargs| |lser| |lsyms| |nsym| #1=#:G2120 |s| #2=#:G2121 |e| #3=#:G2122
         |c|)
    (RETURN
     (SEQ (LETT |lsyms| NIL . #4=(|FS2UPS;convertargs|))
          (LETT |lser| NIL . #4#) (LETT |nargs| NIL . #4#)
          (SEQ (LETT |c| NIL . #4#) (LETT #3# |lser0| . #4#)
               (LETT |e| NIL . #4#) (LETT #2# |lsere| . #4#)
               (LETT |s| NIL . #4#) (LETT #1# |lsers| . #4#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |s| (CAR #1#) . #4#) NIL)
                     (ATOM #2#) (PROGN (LETT |e| (CAR #2#) . #4#) NIL)
                     (ATOM #3#) (PROGN (LETT |c| (CAR #3#) . #4#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (COND
                  ((SPADCALL |e| (|spadConstant| $ 22) (QREFELT $ 24))
                   (LETT |nargs| (CONS |c| |nargs|) . #4#))
                  ('T
                   (SEQ (LETT |nsym| (SPADCALL (QREFELT $ 88)) . #4#)
                        (LETT |nargs|
                              (CONS
                               (SPADCALL |c| (SPADCALL |nsym| (QREFELT $ 81))
                                         (QREFELT $ 89))
                               |nargs|)
                              . #4#)
                        (LETT |lsyms| (CONS |nsym| |lsyms|) . #4#)
                        (EXIT (LETT |lser| (CONS |s| |lser|) . #4#)))))))
               (LETT #1#
                     (PROG1 (CDR #1#)
                       (LETT #2# (PROG1 (CDR #2#) (LETT #3# (CDR #3#) . #4#))
                             . #4#))
                     . #4#)
               (GO G190) G191 (EXIT NIL))
          (LETT |nargs| (NREVERSE |nargs|) . #4#)
          (EXIT (VECTOR |nargs| |lser| |lsyms|)))))) 

(DEFUN |FS2UPS;doell| (|losers| |lsers| |lsere| |lser0| |ef| $)
  (PROG (|nres| |cargs|)
    (RETURN
     (SEQ
      (LETT |cargs|
            (|FS2UPS;convertargs| (CDR |lsers|) (CDR |lsere|) (CDR |lser0|) $)
            . #1=(|FS2UPS;doell|))
      (LETT |nres|
            (SPADCALL (CONS #'|FS2UPS;doell!0| (VECTOR |ef| |cargs|))
                      (SPADCALL |losers| 1 (QREFELT $ 90)) (QREFELT $ 92))
            . #1#)
      (EXIT
       (|FS2UPS;dotaylorviaderiv| |nres| (QVELT |cargs| 2) (QVELT |cargs| 1)
        $)))))) 

(DEFUN |FS2UPS;doell!0| (|f| $$)
  (PROG (|cargs| |ef|)
    (LETT |cargs| (QREFELT $$ 1) . #1=(|FS2UPS;doell|))
    (LETT |ef| (QREFELT $$ 0) . #1#)
    (RETURN (PROGN (SPADCALL |f| (QVELT |cargs| 0) |ef|))))) 

(DEFUN |FS2UPS;doell2| (|losers| |lsers| |lsere| |lser0| |ef| $)
  (PROG ()
    (RETURN
     (|FS2UPS;doell| |losers| |lsers| |lsere| |lser0|
      (CONS #'|FS2UPS;doell2!0| (VECTOR |ef| $)) $)))) 

(DEFUN |FS2UPS;doell2!0| (|f| |l| $$)
  (PROG ($ |ef|)
    (LETT $ (QREFELT $$ 1) . #1=(|FS2UPS;doell2|))
    (LETT |ef| (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (SPADCALL |f| (SPADCALL |l| (|spadConstant| $ 93) (QREFELT $ 95))
                |ef|))))) 

(DEFUN |FS2UPS;doell3| (|losers| |lsers| |lsere| |lser0| |ef| $)
  (PROG ()
    (RETURN
     (|FS2UPS;doell| |losers| |lsers| |lsere| |lser0|
      (CONS #'|FS2UPS;doell3!0| (VECTOR |ef| $)) $)))) 

(DEFUN |FS2UPS;doell3!0| (|f| |l| $$)
  (PROG ($ |ef|)
    (LETT $ (QREFELT $$ 1) . #1=(|FS2UPS;doell3|))
    (LETT |ef| (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (SPADCALL |f| (SPADCALL |l| (|spadConstant| $ 93) (QREFELT $ 95))
                (SPADCALL |l| 2 (QREFELT $ 95)) |ef|))))) 

(DEFUN |FS2UPS;besselEq| (|lc| |z0| $)
  (PROG (|zvar| |v|)
    (RETURN
     (SEQ
      (LETT |v| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;besselEq|))
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (EXIT
       (LIST (SPADCALL |zvar| 2 (QREFELT $ 98)) |zvar|
             (SPADCALL (SPADCALL |zvar| 2 (QREFELT $ 98))
                       (SPADCALL |v| 2 (QREFELT $ 98)) (QREFELT $ 75)))))))) 

(DEFUN |FS2UPS;besselEqm| (|lc| |z0| $)
  (PROG (|zvar| |v|)
    (RETURN
     (SEQ
      (LETT |v| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;besselEqm|))
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (EXIT
       (LIST (SPADCALL |zvar| 2 (QREFELT $ 98)) |zvar|
             (SPADCALL (SPADCALL |zvar| 2 (QREFELT $ 98))
                       (SPADCALL |v| 2 (QREFELT $ 98)) (QREFELT $ 50)))))))) 

(DEFUN |FS2UPS;kelvinEq| (|lc| |z0| $)
  (PROG (|v2| |zvar| |v|)
    (RETURN
     (SEQ
      (LETT |v| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;kelvinEq|))
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (LETT |v2|
            (SPADCALL (|spadConstant| $ 52)
                      (SPADCALL 2 (SPADCALL |v| 2 (QREFELT $ 98))
                                (QREFELT $ 99))
                      (QREFELT $ 50))
            . #1#)
      (EXIT
       (LIST (SPADCALL |zvar| 4 (QREFELT $ 98))
             (SPADCALL 2 (SPADCALL |zvar| 3 (QREFELT $ 98)) (QREFELT $ 99))
             (SPADCALL
              (SPADCALL |v2| (SPADCALL |zvar| 2 (QREFELT $ 98)) (QREFELT $ 53))
              (QREFELT $ 100))
             (SPADCALL |v2| |zvar| (QREFELT $ 53))
             (SPADCALL
              (SPADCALL (SPADCALL |v| 2 (QREFELT $ 98))
                        (SPADCALL 4 (SPADCALL |v| 2 (QREFELT $ 98))
                                  (QREFELT $ 99))
                        (QREFELT $ 75))
              (SPADCALL |zvar| 4 (QREFELT $ 98)) (QREFELT $ 50)))))))) 

(DEFUN |FS2UPS;kummerEq| (|lc| |z0| $)
  (PROG (|zvar| |b| |a|)
    (RETURN
     (SEQ
      (LETT |a| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;kummerEq|))
      (LETT |b| (SPADCALL (SPADCALL |lc| 2 (QREFELT $ 95)) (QREFELT $ 73))
            . #1#)
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (EXIT
       (LIST |zvar| (SPADCALL |b| |zvar| (QREFELT $ 75))
             (SPADCALL |a| (QREFELT $ 100)))))))) 

(DEFUN |FS2UPS;legendreEq| (|lc| |z0| $)
  (PROG (|z2| |zvar| |mu| |nu|)
    (RETURN
     (SEQ
      (LETT |nu| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;legendreEq|))
      (LETT |mu| (SPADCALL (SPADCALL |lc| 2 (QREFELT $ 95)) (QREFELT $ 73))
            . #1#)
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (LETT |z2|
            (SPADCALL (|spadConstant| $ 52) (SPADCALL |zvar| 2 (QREFELT $ 98))
                      (QREFELT $ 75))
            . #1#)
      (EXIT
       (LIST (SPADCALL |z2| 2 (QREFELT $ 98))
             (SPADCALL
              (SPADCALL (SPADCALL 2 |zvar| (QREFELT $ 99)) |z2| (QREFELT $ 53))
              (QREFELT $ 100))
             (SPADCALL
              (SPADCALL
               (SPADCALL |nu|
                         (SPADCALL |nu| (|spadConstant| $ 52) (QREFELT $ 50))
                         (QREFELT $ 53))
               |z2| (QREFELT $ 53))
              |mu| (QREFELT $ 75)))))))) 

(DEFUN |FS2UPS;whittakerEq| (|lc| |z0| $)
  (PROG (|zvar| |o4| |m| |k|)
    (RETURN
     (SEQ
      (LETT |k| (SPADCALL (SPADCALL |lc| 1 (QREFELT $ 95)) (QREFELT $ 73))
            . #1=(|FS2UPS;whittakerEq|))
      (LETT |m| (SPADCALL (SPADCALL |lc| 2 (QREFELT $ 95)) (QREFELT $ 73))
            . #1#)
      (LETT |o4|
            (SPADCALL (|spadConstant| $ 52)
                      (SPADCALL (SPADCALL 4 (QREFELT $ 101)) (QREFELT $ 102))
                      (QREFELT $ 103))
            . #1#)
      (LETT |zvar|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                       (QREFELT $ 61))
             (SPADCALL |z0| (QREFELT $ 73)) (QREFELT $ 50))
            . #1#)
      (EXIT
       (LIST (SPADCALL |zvar| 2 (QREFELT $ 98)) (|spadConstant| $ 49)
             (SPADCALL
              (SPADCALL
               (SPADCALL |o4| (SPADCALL |m| 2 (QREFELT $ 98)) (QREFELT $ 75))
               (SPADCALL |k| |zvar| (QREFELT $ 53)) (QREFELT $ 50))
              (SPADCALL (SPADCALL |zvar| 2 (QREFELT $ 98))
                        (SPADCALL (SPADCALL 4 (QREFELT $ 101)) (QREFELT $ 102))
                        (QREFELT $ 103))
              (QREFELT $ 75)))))))) 

(DEFUN |FS2UPS;dodiffeq| (|ker| |losers| |lsers| |lsere| |lser0| |getEq| $)
  (PROG (|ups| |lc| #1=#:G2165 |c| #2=#:G2164 |nker| #3=#:G2163 |lsyms| |sym|
         |ecl| #4=#:G2162 #5=#:G2161 |cn1| |cn| |z0| |nargs| |cargs|)
    (RETURN
     (SEQ
      (LETT |cargs| (|FS2UPS;convertargs| |lsers| |lsere| |lser0| $)
            . #6=(|FS2UPS;dodiffeq|))
      (LETT |nargs| (QVELT |cargs| 0) . #6#)
      (EXIT
       (COND
        ((SPADCALL (SPADCALL |lsere| (QREFELT $ 104)) (|spadConstant| $ 22)
                   (QREFELT $ 24))
         (SEQ
          (LETT |nker|
                (SPADCALL (SPADCALL |ker| (QREFELT $ 107)) |nargs|
                          (QREFELT $ 109))
                . #6#)
          (EXIT
           (|FS2UPS;dotaylorviaderiv2| |nker| (QVELT |cargs| 2)
            (QVELT |cargs| 1) $))))
        ('T
         (SEQ (LETT |z0| (SPADCALL |lser0| (QREFELT $ 104)) . #6#)
              (LETT |ecl| (SPADCALL |nargs| |z0| |getEq|) . #6#)
              (LETT |cn| (|SPADfirst| |ecl|) . #6#)
              (LETT |cn1|
                    (SPADCALL
                     (SPADCALL |cn|
                               (SPADCALL (|spadConstant| $ 52) (QREFELT $ 100))
                               (QREFELT $ 111))
                     (QREFELT $ 100))
                    . #6#)
              (LETT |ecl|
                    (PROGN
                     (LETT #5# NIL . #6#)
                     (SEQ (LETT |c| NIL . #6#) (LETT #4# (CDR |ecl|) . #6#)
                          G190
                          (COND
                           ((OR (ATOM #4#)
                                (PROGN (LETT |c| (CAR #4#) . #6#) NIL))
                            #7=(GO G191)))
                          (SEQ
                           (EXIT
                            (LETT #5#
                                  (CONS (SPADCALL |c| |cn1| (QREFELT $ 53))
                                        #5#)
                                  . #6#)))
                          (LETT #4# (CDR #4#) . #6#) #8=(GO G190) G191
                          (EXIT (NREVERSE0 #5#))))
                    . #6#)
              (LETT |nker|
                    (SPADCALL (SPADCALL |ker| (QREFELT $ 107)) |nargs|
                              (QREFELT $ 109))
                    . #6#)
              (LETT |lc| (LIST |nker|) . #6#)
              (LETT |lsyms| (QVELT |cargs| 2) . #6#)
              (LETT |sym| (|SPADfirst| |lsyms|) . #6#)
              (LETT |lsyms| (CDR |lsyms|) . #6#)
              (LETT |lsers| (CDR (QVELT |cargs| 1)) . #6#)
              (SEQ (LETT |c| NIL . #6#) (LETT #3# (CDR |ecl|) . #6#) G190
                   (COND
                    ((OR (ATOM #3#) (PROGN (LETT |c| (CAR #3#) . #6#) NIL))
                     #7#))
                   (SEQ
                    (LETT |nker| (SPADCALL |nker| |sym| (QREFELT $ 76)) . #6#)
                    (EXIT (LETT |lc| (CONS |nker| |lc|) . #6#)))
                   (LETT #3# (CDR #3#) . #6#) #8# G191 (EXIT NIL))
              (LETT |lc|
                    (PROGN
                     (LETT #2# NIL . #6#)
                     (SEQ (LETT |c| NIL . #6#) (LETT #1# (NREVERSE |lc|) . #6#)
                          G190
                          (COND
                           ((OR (ATOM #1#)
                                (PROGN (LETT |c| (CAR #1#) . #6#) NIL))
                            #7#))
                          (SEQ
                           (EXIT
                            (LETT #2#
                                  (CONS
                                   (SPADCALL |c|
                                             (SPADCALL
                                              (SPADCALL |sym| (QREFELT $ 81))
                                              (|spadConstant| $ 22)
                                              (QREFELT $ 83))
                                             (QREFELT $ 113))
                                   #2#)
                                  . #6#)))
                          (LETT #1# (CDR #1#) . #6#) #8# G191
                          (EXIT (NREVERSE0 #2#))))
                    . #6#)
              (LETT |ups|
                    (SPADCALL (REVERSE |ecl|) (|SPADfirst| (QVELT |cargs| 1))
                              |lc| (QREFELT $ 114))
                    . #6#)
              (EXIT (|FS2UPS;dotaylorviaderiv| |ups| |lsyms| |lsers| $)))))))))) 

(DEFUN |FS2UPS;spectoUPS| (|ker| |args| |posCheck?| |atanFlag| $)
  (PROG (|nker| |nargs| |cargs| |nm| |lser0| |lsere| |lsers| |losers| |ares|
         |aresu|)
    (RETURN
     (SEQ
      (LETT |aresu| (|FS2UPS;handleargs| |args| |posCheck?| |atanFlag| $)
            . #1=(|FS2UPS;spectoUPS|))
      (EXIT
       (COND ((QEQCAR |aresu| 1) (QCDR |aresu|))
             (#2='T
              (SEQ (LETT |ares| (QCDR |aresu|) . #1#)
                   (LETT |losers| (QVELT |ares| 0) . #1#)
                   (LETT |lsers| (QVELT |ares| 1) . #1#)
                   (LETT |lsere| (QVELT |ares| 2) . #1#)
                   (LETT |lser0| (QVELT |ares| 3) . #1#)
                   (LETT |nm| (SPADCALL |ker| (QREFELT $ 115)) . #1#)
                   (COND
                    ((OR (EQUAL |nm| '|besselI|) (EQUAL |nm| '|besselK|))
                     (EXIT
                      (COND
                       ((SPADCALL (SPADCALL |lser0| 2 (QREFELT $ 95))
                                  (|spadConstant| $ 22) (QREFELT $ 24))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at 0" $))
                       (#2#
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;besselEqm|) $)
                         $))))))
                   (COND
                    ((OR (EQUAL |nm| '|besselJ|)
                         (OR (EQUAL |nm| '|besselY|)
                             (OR (EQUAL |nm| '|hankelH1|)
                                 (EQUAL |nm| '|hankelH2|))))
                     (EXIT
                      (COND
                       ((SPADCALL (SPADCALL |lser0| 2 (QREFELT $ 95))
                                  (|spadConstant| $ 22) (QREFELT $ 24))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at 0" $))
                       (#2#
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;besselEq|) $)
                         $))))))
                   (COND
                    ((OR (EQUAL |nm| '|kummerM|) (EQUAL |nm| '|kummerU|))
                     (EXIT
                      (COND
                       ((SPADCALL (SPADCALL |lser0| 3 (QREFELT $ 95))
                                  (|spadConstant| $ 22) (QREFELT $ 24))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at 0" $))
                       (#2#
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;kummerEq|) $)
                         $))))))
                   (COND
                    ((OR (EQUAL |nm| '|whittakerM|) (EQUAL |nm| '|whittakerW|))
                     (EXIT
                      (COND
                       ((SPADCALL (SPADCALL |lser0| 3 (QREFELT $ 95))
                                  (|spadConstant| $ 22) (QREFELT $ 24))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at 0" $))
                       (#2#
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;whittakerEq|) $)
                         $))))))
                   (COND
                    ((OR
                      (OR
                       (OR (EQUAL |nm| '|kelvinBer|) (EQUAL |nm| '|kelvinBei|))
                       (EQUAL |nm| '|kelvinKer|))
                      (EQUAL |nm| '|kelvinKei|))
                     (EXIT
                      (COND
                       ((SPADCALL (SPADCALL |lser0| 2 (QREFELT $ 95))
                                  (|spadConstant| $ 22) (QREFELT $ 24))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at 0" $))
                       (#2#
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;kelvinEq|) $)
                         $))))))
                   (COND
                    ((OR (EQUAL |nm| '|legendreP|) (EQUAL |nm| '|legendreQ|))
                     (EXIT
                      (COND
                       ((OR
                         (SPADCALL (SPADCALL |lser0| 3 (QREFELT $ 95))
                                   (|spadConstant| $ 18) (QREFELT $ 24))
                         (SPADCALL (SPADCALL |lser0| 3 (QREFELT $ 95))
                                   (SPADCALL (|spadConstant| $ 18)
                                             (QREFELT $ 118))
                                   (QREFELT $ 24)))
                        (|FS2UPS;stateProblem| (SPADCALL |nm| (QREFELT $ 117))
                         "expansion at +-1" $))
                       ('T
                        (|FS2UPS;dodiffeq| |ker| |losers| |lsers| |lsere|
                         |lser0| (CONS (|function| |FS2UPS;legendreEq|) $)
                         $))))))
                   (EXIT
                    (COND
                     ((EQUAL |nm| '|jacobiSn|)
                      (|FS2UPS;doell2| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 119) $))
                     ((EQUAL |nm| '|jacobiCn|)
                      (|FS2UPS;doell2| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 120) $))
                     ((EQUAL |nm| '|jacobiDn|)
                      (|FS2UPS;doell2| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 121) $))
                     ((EQUAL |nm| '|ellipticE2|)
                      (|FS2UPS;doell2| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 122) $))
                     ((EQUAL |nm| '|ellipticF|)
                      (|FS2UPS;doell2| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 123) $))
                     ((EQUAL |nm| '|ellipticPi|)
                      (|FS2UPS;doell3| |losers| |lsers| |lsere| |lser0|
                       (ELT $ 124) $))
                     (#2#
                      (SEQ
                       (LETT |cargs|
                             (|FS2UPS;convertargs| |lsers| |lsere| |lser0| $)
                             . #1#)
                       (LETT |nargs| (QVELT |cargs| 0) . #1#)
                       (LETT |nker|
                             (SPADCALL (SPADCALL |ker| (QREFELT $ 107)) |nargs|
                                       (QREFELT $ 109))
                             . #1#)
                       (EXIT
                        (|FS2UPS;dotaylorviaderiv2| |nker| (QVELT |cargs| 2)
                         (QVELT |cargs| 1) $)))))))))))))) 

(DEFUN |FS2UPS;kernelToUPS| (|ker| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G2273 |n| |arg| |op| |args| |sym|)
    (RETURN
     (SEQ
      (LETT |sym| (SPADCALL |ker| (QREFELT $ 126)) . #2=(|FS2UPS;kernelToUPS|))
      (EXIT
       (COND
        ((QEQCAR |sym| 0)
         (COND
          ((EQUAL (QCDR |sym|) (QREFELT $ 13))
           (CONS 0
                 (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                           (QREFELT $ 61))))
          (#3='T
           (CONS 0
                 (SPADCALL (SPADCALL |ker| (QREFELT $ 128))
                           (|spadConstant| $ 66) (QREFELT $ 61))))))
        ((OR (NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 129)) . #2#))
             (NULL
              (SPADCALL (QREFELT $ 13)
                        (SPADCALL (SPADCALL |ker| (QREFELT $ 128))
                                  (QREFELT $ 71))
                        (QREFELT $ 72))))
         (CONS 0
               (SPADCALL (SPADCALL |ker| (QREFELT $ 128)) (|spadConstant| $ 66)
                         (QREFELT $ 61))))
        ('T
         (SEQ (LETT |op| (SPADCALL |ker| (QREFELT $ 107)) . #2#)
              (EXIT
               (COND
                ((SPADCALL |op| '|special| (QREFELT $ 130))
                 (|FS2UPS;spectoUPS| |ker| |args| |posCheck?| |atanFlag| $))
                ((NULL (CDR |args|))
                 (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
                      (EXIT
                       (COND
                        ((SPADCALL |ker| '|abs| (QREFELT $ 131))
                         (|FS2UPS;nthRootToUPS|
                          (SPADCALL |arg| |arg| (QREFELT $ 132)) 2 |posCheck?|
                          |atanFlag| $))
                        ((SPADCALL |ker| '|%paren| (QREFELT $ 131))
                         (SPADCALL |arg| |posCheck?| |atanFlag|
                                   (QREFELT $ 48)))
                        ((SPADCALL |ker| '|log| (QREFELT $ 131))
                         (|FS2UPS;logToUPS| |arg| |posCheck?| |atanFlag| $))
                        ((SPADCALL |ker| '|exp| (QREFELT $ 131))
                         (|FS2UPS;applyIfCan| (ELT $ 133) |arg| "exp"
                          |posCheck?| |atanFlag| $))
                        (#3#
                         (|FS2UPS;tranToUPS| |ker| |arg| |posCheck?| |atanFlag|
                          $))))))
                ((SPADCALL |ker| '|%power| (QREFELT $ 131))
                 (|FS2UPS;powToUPS| |args| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| '|nthRoot| (QREFELT $ 131))
                 (SEQ
                  (LETT |n|
                        (SPADCALL (SPADCALL |args| (QREFELT $ 134))
                                  (QREFELT $ 135))
                        . #2#)
                  (EXIT
                   (|FS2UPS;nthRootToUPS| (|SPADfirst| |args|)
                    (PROG1 (LETT #1# |n| . #2#)
                      (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))
                    |posCheck?| |atanFlag| $))))
                (#3#
                 (|FS2UPS;stateProblem|
                  (SPADCALL (SPADCALL |ker| (QREFELT $ 115)) (QREFELT $ 117))
                  "unknown kernel" $)))))))))))) 

(DEFUN |FS2UPS;nthRootToUPS| (|arg| |n| |posCheck?| |atanFlag| $)
  (PROG (|ans| |result|)
    (RETURN
     (SEQ
      (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 48))
            . #1=(|FS2UPS;nthRootToUPS|))
      (EXIT
       (COND ((QEQCAR |result| 1) |result|)
             (#2='T
              (SEQ
               (LETT |ans|
                     (|FS2UPS;carefulNthRootIfCan| (CDR |result|) |n|
                      |posCheck?| 'NIL $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |ans| 1) |ans|)
                      (#2# (CONS 0 (CDR |ans|))))))))))))) 

(DEFUN |FS2UPS;logToUPS| (|arg| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G2304 #2=#:G2306 #3=#:G2308 |signum| |coef| |ups| #4=#:G2058
         |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 48))
              . #5=(|FS2UPS;logToUPS|))
        (EXIT
         (COND ((QEQCAR |result| 1) |result|)
               ('T
                (SEQ
                 (EXIT
                  (SEQ
                   (LETT |ups|
                         (PROG2
                             (LETT #4# |result| . #5#)
                             (QCDR #4#)
                           (|check-union| (QEQCAR #4# 0) (QREFELT $ 9) #4#))
                         . #5#)
                   (COND
                    ((NULL
                      (SPADCALL
                       (SPADCALL |ups| (|spadConstant| $ 96) (QREFELT $ 28))
                       (QREFELT $ 33)))
                     (EXIT
                      (|FS2UPS;stateProblem| "log" "series of non-zero order"
                       $))))
                   (LETT |coef|
                         (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 20))
                         . #5#)
                   (COND
                    (|posCheck?|
                     (SEQ
                      (LETT |signum| (SPADCALL |coef| (QREFELT $ 32)) . #5#)
                      (EXIT
                       (COND
                        ((QEQCAR |signum| 0)
                         (COND
                          ((EQL (QCDR |signum|) -1)
                           (PROGN
                            (LETT #2#
                                  (PROGN
                                   (LETT #3#
                                         (|FS2UPS;stateProblem| "log"
                                          "negative leading coefficient" $)
                                         . #5#)
                                   (GO #3#))
                                  . #5#)
                            (GO #2#))))))))))
                   (EXIT
                    (CONS 0
                          (PROG2
                              (LETT #1# (SPADCALL |ups| (QREFELT $ 136)) . #5#)
                              (QCDR #1#)
                            (|check-union| (QEQCAR #1# 0) (QREFELT $ 9)
                                           #1#))))))
                 #2# (EXIT #2#)))))))
      #3# (EXIT #3#))))) 

(DEFUN |FS2UPS;localAbs;2FE;27| (|fcn| $) (SPADCALL |fcn| (QREFELT $ 137))) 

(DEFUN |FS2UPS;localAbs;2FE;28| (|fcn| $)
  (SPADCALL (SPADCALL |fcn| |fcn| (QREFELT $ 132)) (QREFELT $ 139))) 

(DEFUN |FS2UPS;signOfExpression| (|arg| $)
  (SPADCALL (SPADCALL |arg| (QREFELT $ 138)) |arg| (QREFELT $ 140))) 

(DEFUN |FS2UPS;atancotToUPS| (|arg| |posCheck?| |atanFlag| |plusMinus| $)
  (PROG (|cc| |n| |left?| |posNegPi2| |signum| |lc| #1=#:G2335 |rn| #2=#:G2333
         |ord| |coef| |ups| #3=#:G2058 |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 48))
              . #4=(|FS2UPS;atancotToUPS|))
        (EXIT
         (COND ((QEQCAR |result| 1) |result|)
               (#5='T
                (SEQ
                 (EXIT
                  (SEQ
                   (LETT |ups|
                         (PROG2
                             (LETT #3# |result| . #4#)
                             (QCDR #3#)
                           (|check-union| (QEQCAR #3# 0) (QREFELT $ 9) #3#))
                         . #4#)
                   (LETT |coef|
                         (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 20))
                         . #4#)
                   (SEQ
                    (LETT |ord|
                          (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 28))
                          . #4#)
                    (EXIT
                     (COND
                      ((SPADCALL |ord| (|spadConstant| $ 66) (QREFELT $ 141))
                       (COND
                        ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 132))
                                   (SPADCALL (|spadConstant| $ 18)
                                             (QREFELT $ 118))
                                   (QREFELT $ 24))
                         (PROGN
                          (LETT #2#
                                (PROGN
                                 (LETT #1#
                                       (|FS2UPS;stateProblem| "atan"
                                        "logarithmic singularity" $)
                                       . #4#)
                                 (GO #1#))
                                . #4#)
                          (GO #2#))))))))
                   (LETT |cc|
                         (COND
                          ((SPADCALL |ord| (|spadConstant| $ 66)
                                     (QREFELT $ 74))
                           (COND
                            ((SPADCALL |atanFlag| (CONS 0 "complex")
                                       (QREFELT $ 142))
                             (PROGN
                              (LETT #1#
                                    (|FS2UPS;stateProblem| "atan"
                                     "essential singularity" $)
                                    . #4#)
                              (GO #1#)))
                            (#5#
                             (SEQ
                              (LETT |rn|
                                    (|FS2UPS;ratIfCan|
                                     (SPADCALL |ord| (QREFELT $ 143)) $)
                                    . #4#)
                              (EXIT
                               (COND
                                ((QEQCAR |rn| 1)
                                 (PROGN
                                  (LETT #1#
                                        (|FS2UPS;stateProblem| "atan"
                                         "branch problem" $)
                                        . #4#)
                                  (GO #1#)))
                                (#5#
                                 (SEQ
                                  (COND
                                   ((SPADCALL |atanFlag|
                                              (CONS 1 "real: two sides")
                                              (QREFELT $ 142))
                                    (COND
                                     ((ODDP
                                       (SPADCALL (QCDR |rn|) (QREFELT $ 145)))
                                      (PROGN
                                       (LETT #1#
                                             (|FS2UPS;stateProblem| "atan"
                                              "branch problem" $)
                                             . #4#)
                                       (GO #1#))))))
                                  (LETT |lc|
                                        (SPADCALL |ups| |ord| (QREFELT $ 20))
                                        . #4#)
                                  (LETT |signum| (SPADCALL |lc| (QREFELT $ 32))
                                        . #4#)
                                  (EXIT
                                   (COND
                                    ((QEQCAR |signum| 1)
                                     (COND
                                      ((SPADCALL |atanFlag|
                                                 (CONS 4 "just do it")
                                                 (QREFELT $ 142))
                                       (COND
                                        ((EQL |plusMinus| 1)
                                         (SPADCALL (SPADCALL (QREFELT $ 146))
                                                   (SPADCALL 2 (QREFELT $ 149))
                                                   (QREFELT $ 140)))
                                        (#5# (|spadConstant| $ 22))))
                                      (#5#
                                       (SEQ
                                        (LETT |posNegPi2|
                                              (SPADCALL
                                               (SPADCALL
                                                (|FS2UPS;signOfExpression| |lc|
                                                 $)
                                                (SPADCALL (QREFELT $ 146))
                                                (QREFELT $ 132))
                                               (SPADCALL 2 (QREFELT $ 149))
                                               (QREFELT $ 140))
                                              . #4#)
                                        (EXIT
                                         (COND
                                          ((EQL |plusMinus| 1) |posNegPi2|)
                                          (#5#
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL (QREFELT $ 146))
                                             (SPADCALL 2 (QREFELT $ 149))
                                             (QREFELT $ 140))
                                            |posNegPi2| (QREFELT $ 150)))))))))
                                    (#5#
                                     (SEQ
                                      (LETT |left?|
                                            (SPADCALL |atanFlag|
                                                      (CONS 2
                                                            "real: left side")
                                                      (QREFELT $ 142))
                                            . #4#)
                                      (LETT |n| (QCDR |signum|) . #4#)
                                      (COND
                                       (|left?|
                                        (COND
                                         ((EQL |n| 1)
                                          (EXIT
                                           (COND
                                            ((EQL |plusMinus| 1)
                                             (SPADCALL
                                              (SPADCALL
                                               (SPADCALL (QREFELT $ 146))
                                               (SPADCALL 2 (QREFELT $ 149))
                                               (QREFELT $ 140))
                                              (QREFELT $ 118)))
                                            (#5# (SPADCALL (QREFELT $ 146))))))
                                         ((NULL |left?|)
                                          (COND
                                           ((EQL |n| -1)
                                            (EXIT
                                             (COND
                                              ((EQL |plusMinus| 1)
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL (QREFELT $ 146))
                                                 (SPADCALL 2 (QREFELT $ 149))
                                                 (QREFELT $ 140))
                                                (QREFELT $ 118)))
                                              (#5#
                                               (SPADCALL
                                                (QREFELT $ 146))))))))))
                                       ((EQL |n| -1)
                                        (EXIT
                                         (COND
                                          ((EQL |plusMinus| 1)
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL (QREFELT $ 146))
                                             (SPADCALL 2 (QREFELT $ 149))
                                             (QREFELT $ 140))
                                            (QREFELT $ 118)))
                                          (#5# (SPADCALL (QREFELT $ 146)))))))
                                      (EXIT
                                       (COND
                                        ((EQL |plusMinus| 1)
                                         (SPADCALL (SPADCALL (QREFELT $ 146))
                                                   (SPADCALL 2 (QREFELT $ 149))
                                                   (QREFELT $ 140)))
                                        (#5#
                                         (|spadConstant| $ 22))))))))))))))))
                          (#5# (SPADCALL |coef| (QREFELT $ 151))))
                         . #4#)
                   (EXIT
                    (CONS 0
                          (SPADCALL (SPADCALL |cc| (QREFELT $ 73))
                                    (SPADCALL
                                     (SPADCALL
                                      (SPADCALL |plusMinus|
                                                (SPADCALL |ups|
                                                          (QREFELT $ 152))
                                                (QREFELT $ 153))
                                      (SPADCALL (|spadConstant| $ 52)
                                                (SPADCALL |ups| |ups|
                                                          (QREFELT $ 53))
                                                (QREFELT $ 50))
                                      (QREFELT $ 154))
                                     (QREFELT $ 155))
                                    (QREFELT $ 50))))))
                 #2# (EXIT #2#)))))))
      #1# (EXIT #1#))))) 

(DEFUN |FS2UPS;applyIfCan| (|fcn| |arg| |fcnName| |posCheck?| |atanFlag| $)
  (PROG (|ans| |ups|)
    (RETURN
     (SEQ
      (LETT |ups| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 48))
            . #1=(|FS2UPS;applyIfCan|))
      (EXIT
       (COND ((QEQCAR |ups| 1) |ups|)
             (#2='T
              (SEQ (LETT |ans| (SPADCALL (CDR |ups|) |fcn|) . #1#)
                   (EXIT
                    (COND
                     ((QEQCAR |ans| 1)
                      (|FS2UPS;stateProblem| |fcnName| "essential singularity"
                       $))
                     (#2# (CONS 0 (QCDR |ans|))))))))))))) 

(DEFUN |FS2UPS;tranToUPS| (|ker| |arg| |posCheck?| |atanFlag| $)
  (COND
   ((SPADCALL |ker| '|sin| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 156) |arg| "sin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|cos| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 157) |arg| "cos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|tan| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 158) |arg| "tan" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|cot| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 159) |arg| "cot" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|sec| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 160) |arg| "sec" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|csc| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 161) |arg| "csc" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|asin| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 162) |arg| "asin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|acos| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 163) |arg| "acos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|atan| (QREFELT $ 131))
    (|FS2UPS;atancotToUPS| |arg| |posCheck?| |atanFlag| 1 $))
   ((SPADCALL |ker| '|acot| (QREFELT $ 131))
    (|FS2UPS;atancotToUPS| |arg| |posCheck?| |atanFlag| -1 $))
   ((SPADCALL |ker| '|asec| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 164) |arg| "asec" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|acsc| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 165) |arg| "acsc" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|sinh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 166) |arg| "sinh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|cosh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 167) |arg| "cosh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|tanh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 168) |arg| "tanh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|coth| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 169) |arg| "coth" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|sech| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 170) |arg| "sech" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|csch| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 171) |arg| "csch" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|asinh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 172) |arg| "asinh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|acosh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 173) |arg| "acosh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|atanh| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 174) |arg| "atanh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|acoth| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 175) |arg| "acoth" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|asech| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 176) |arg| "asech" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|acsch| (QREFELT $ 131))
    (|FS2UPS;applyIfCan| (ELT $ 177) |arg| "acsch" |posCheck?| |atanFlag| $))
   ('T
    (|FS2UPS;stateProblem|
     (SPADCALL (SPADCALL |ker| (QREFELT $ 115)) (QREFELT $ 117))
     "unknown kernel" $)))) 

(DEFUN |FS2UPS;powToUPS| (|args| |posCheck?| |atanFlag| $)
  (PROG (|ans| |expon| |logBase|)
    (RETURN
     (SEQ
      (LETT |logBase|
            (|FS2UPS;logToUPS| (|SPADfirst| |args|) |posCheck?| |atanFlag| $)
            . #1=(|FS2UPS;powToUPS|))
      (EXIT
       (COND ((QEQCAR |logBase| 1) |logBase|)
             (#2='T
              (SEQ
               (LETT |expon|
                     (SPADCALL (SPADCALL |args| (QREFELT $ 134)) |posCheck?|
                               |atanFlag| (QREFELT $ 48))
                     . #1#)
               (EXIT
                (COND ((QEQCAR |expon| 1) |expon|)
                      (#2#
                       (SEQ
                        (LETT |ans|
                              (SPADCALL
                               (SPADCALL (CDR |expon|) (CDR |logBase|)
                                         (QREFELT $ 53))
                               (QREFELT $ 133))
                              . #1#)
                        (EXIT
                         (COND
                          ((QEQCAR |ans| 1)
                           (|FS2UPS;stateProblem| "exp" "essential singularity"
                            $))
                          (#2# (CONS 0 (QCDR |ans|))))))))))))))))) 

(DEFUN |FS2UPS;newElem| (|f| $)
  (SPADCALL (|FS2UPS;smpElem| (SPADCALL |f| (QREFELT $ 179)) $)
            (|FS2UPS;smpElem| (SPADCALL |f| (QREFELT $ 180)) $)
            (QREFELT $ 140))) 

(DEFUN |FS2UPS;smpElem| (|p| $)
  (SPADCALL (CONS (|function| |FS2UPS;k2Elem|) $) (ELT $ 102) |p|
            (QREFELT $ 185))) 

(DEFUN |FS2UPS;k2Elem| (|k| $)
  (PROG (|cosz| |sinz| |iez| |ez| |z| |args| #1=#:G2436 |a| #2=#:G2435)
    (RETURN
     (SEQ
      (LETT |args|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;k2Elem|))
             (SEQ (LETT |a| NIL . #3#)
                  (LETT #1# (SPADCALL |k| (QREFELT $ 129)) . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |a| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT (LETT #2# (CONS (|FS2UPS;newElem| |a| $) #2#) . #3#)))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT
       (COND ((NULL |args|) (SPADCALL |k| (QREFELT $ 128)))
             (#4='T
              (SEQ
               (LETT |iez|
                     (SPADCALL
                      (LETT |ez|
                            (SPADCALL (LETT |z| (|SPADfirst| |args|) . #3#)
                                      (QREFELT $ 186))
                            . #3#)
                      (QREFELT $ 187))
                     . #3#)
               (LETT |sinz| (SPADCALL |z| (QREFELT $ 188)) . #3#)
               (LETT |cosz| (SPADCALL |z| (QREFELT $ 189)) . #3#)
               (EXIT
                (COND
                 ((SPADCALL |k| '|tan| (QREFELT $ 131))
                  (SPADCALL |sinz| |cosz| (QREFELT $ 140)))
                 ((SPADCALL |k| '|cot| (QREFELT $ 131))
                  (SPADCALL |cosz| |sinz| (QREFELT $ 140)))
                 ((SPADCALL |k| '|sec| (QREFELT $ 131))
                  (SPADCALL |cosz| (QREFELT $ 187)))
                 ((SPADCALL |k| '|csc| (QREFELT $ 131))
                  (SPADCALL |sinz| (QREFELT $ 187)))
                 ((SPADCALL |k| '|sinh| (QREFELT $ 131))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 150))
                            (SPADCALL 2 (QREFELT $ 149)) (QREFELT $ 140)))
                 ((SPADCALL |k| '|cosh| (QREFELT $ 131))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 89))
                            (SPADCALL 2 (QREFELT $ 149)) (QREFELT $ 140)))
                 ((SPADCALL |k| '|tanh| (QREFELT $ 131))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 150))
                            (SPADCALL |ez| |iez| (QREFELT $ 89))
                            (QREFELT $ 140)))
                 ((SPADCALL |k| '|coth| (QREFELT $ 131))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 89))
                            (SPADCALL |ez| |iez| (QREFELT $ 150))
                            (QREFELT $ 140)))
                 ((SPADCALL |k| '|sech| (QREFELT $ 131))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 89))
                                      (QREFELT $ 187))
                            (QREFELT $ 190)))
                 ((SPADCALL |k| '|csch| (QREFELT $ 131))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 150))
                                      (QREFELT $ 187))
                            (QREFELT $ 190)))
                 (#4#
                  (SPADCALL (SPADCALL |k| (QREFELT $ 107)) |args|
                            (QREFELT $ 191))))))))))))) 

(DEFUN |FS2UPS;contOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 192) (QREFELT $ 195))) 

(DEFUN |FS2UPS;bddOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 193) (QREFELT $ 195))) 

(DEFUN |FS2UPS;exprToGenUPS;FEBUU;39| (|fcn| |posCheck?| |atanFlag| $)
  (|FS2UPS;iExprToGenUPS| (|FS2UPS;newElem| |fcn| $) |posCheck?| |atanFlag| $)) 

(DEFUN |FS2UPS;iExprToGenUPS| (|fcn| |posCheck?| |atanFlag| $)
  (PROG (|ker| |power| |expt| |prod| |sum| |poly|)
    (RETURN
     (SEQ
      (LETT |poly| (SPADCALL |fcn| (QREFELT $ 38))
            . #1=(|FS2UPS;iExprToGenUPS|))
      (EXIT
       (COND
        ((QEQCAR |poly| 0)
         (CONS 0
               (|FS2UPS;polyToUPS|
                (SPADCALL (QCDR |poly|) (QREFELT $ 13) (QREFELT $ 42)) $)))
        (#2='T
         (SEQ (LETT |sum| (SPADCALL |fcn| (QREFELT $ 44)) . #1#)
              (EXIT
               (COND
                ((QEQCAR |sum| 0)
                 (|FS2UPS;listToUPS| (QCDR |sum|)
                  (CONS (|function| |FS2UPS;iExprToGenUPS|) $) |posCheck?|
                  |atanFlag| (|spadConstant| $ 49) (ELT $ 50) $))
                (#2#
                 (SEQ (LETT |prod| (SPADCALL |fcn| (QREFELT $ 51)) . #1#)
                      (EXIT
                       (COND
                        ((QEQCAR |prod| 0)
                         (|FS2UPS;listToUPS| (QCDR |prod|)
                          (CONS (|function| |FS2UPS;iExprToGenUPS|) $)
                          |posCheck?| |atanFlag| (|spadConstant| $ 52)
                          (ELT $ 53) $))
                        (#2#
                         (SEQ
                          (LETT |expt| (|FS2UPS;isNonTrivPower| |fcn| $) . #1#)
                          (EXIT
                           (COND
                            ((QEQCAR |expt| 0)
                             (SEQ (LETT |power| (QCDR |expt|) . #1#)
                                  (EXIT
                                   (|FS2UPS;powerToGenUPS| (QCAR |power|)
                                    (QCDR |power|) |posCheck?| |atanFlag| $))))
                            (#2#
                             (SEQ
                              (LETT |ker| (SPADCALL |fcn| (QREFELT $ 55))
                                    . #1#)
                              (EXIT
                               (COND
                                ((QEQCAR |ker| 0)
                                 (|FS2UPS;kernelToGenUPS| (QCDR |ker|)
                                  |posCheck?| |atanFlag| $))
                                (#2#
                                 (|error|
                                  "exprToGenUPS: neither a sum, product, power, nor kernel")))))))))))))))))))))))) 

(DEFUN |FS2UPS;opsInvolvingX| (|fcn| $)
  (PROG (|opList| |op| #1=#:G2483 |k| #2=#:G2482)
    (RETURN
     (SEQ
      (LETT |opList|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;opsInvolvingX|))
             (SEQ (LETT |k| NIL . #3#)
                  (LETT #1# (SPADCALL |fcn| (QREFELT $ 198)) . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |k| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ
                   (EXIT
                    (COND
                     ((COND
                       ((SPADCALL
                         (LETT |op| (SPADCALL |k| (QREFELT $ 107)) . #3#)
                         (QREFELT $ 199))
                        (SPADCALL (QREFELT $ 13)
                                  (SPADCALL
                                   (|SPADfirst| (SPADCALL |k| (QREFELT $ 129)))
                                   (QREFELT $ 71))
                                  (QREFELT $ 72)))
                       ('T 'NIL))
                      (LETT #2# (CONS |op| #2#) . #3#)))))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT (SPADCALL |opList| (QREFELT $ 201))))))) 

(DEFUN |FS2UPS;opInOpList?| (|name| |opList| $)
  (PROG (#1=#:G2485 #2=#:G2487 #3=#:G2488 |op|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (EXIT
          (SEQ (LETT |op| NIL . #4=(|FS2UPS;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 $ 202))
                   (PROGN
                    (LETT #1# (PROGN (LETT #2# 'T . #4#) (GO #2#)) . #4#)
                    (GO #1#))))))
               (LETT #3# (CDR #3#) . #4#) (GO G190) G191 (EXIT NIL)))
         #1# (EXIT #1#))
        (EXIT 'NIL)))
      #2# (EXIT #2#))))) 

(DEFUN |FS2UPS;exponential?| (|fcn| $)
  (PROG (|ker|)
    (RETURN
     (SEQ (LETT |ker| (SPADCALL |fcn| (QREFELT $ 55)) |FS2UPS;exponential?|)
          (EXIT
           (COND
            ((QEQCAR |ker| 0) (SPADCALL (QCDR |ker|) '|exp| (QREFELT $ 131)))
            ('T 'NIL))))))) 

(DEFUN |FS2UPS;productOfNonZeroes?| (|fcn| $)
  (PROG (#1=#:G2499 #2=#:G2503 #3=#:G2504 |term| |prod|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((|FS2UPS;exponential?| |fcn| $) 'T)
             (#4='T
              (SEQ
               (LETT |prod| (SPADCALL |fcn| (QREFELT $ 51))
                     . #5=(|FS2UPS;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 (|FS2UPS;exponential?| |term| $))
                                   (COND
                                    ((SPADCALL (QREFELT $ 13)
                                               (SPADCALL |term| (QREFELT $ 71))
                                               (QREFELT $ 72))
                                     (PROGN
                                      (LETT #1#
                                            (PROGN
                                             (LETT #2# 'NIL . #5#)
                                             (GO #2#))
                                            . #5#)
                                      (GO #1#))))))))
                               (LETT #3# (CDR #3#) . #5#) (GO G190) G191
                               (EXIT NIL)))
                         #1# (EXIT #1#))
                        (EXIT 'T)))))))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2UPS;powerToGenUPS| (|fcn| |n| |posCheck?| |atanFlag| $)
  (PROG (|xOpList| |coef| |deg| |ups| #1=#:G2058 |b|)
    (RETURN
     (SEQ
      (LETT |b| (|FS2UPS;iExprToGenUPS| |fcn| |posCheck?| |atanFlag| $)
            . #2=(|FS2UPS;powerToGenUPS|))
      (EXIT
       (COND ((QEQCAR |b| 1) |b|)
             ((< 0 |n|) (CONS 0 (SPADCALL (CDR |b|) |n| (QREFELT $ 68))))
             (#3='T
              (SEQ
               (LETT |ups|
                     (PROG2
                         (LETT #1# |b| . #2#)
                         (QCDR #1#)
                       (|check-union| (QEQCAR #1# 0) (QREFELT $ 9) #1#))
                     . #2#)
               (LETT |deg| (SPADCALL |ups| (QREFELT $ 19)) . #2#)
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20)) . #2#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 22) (QREFELT $ 24))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 14)
                                                            (QREFELT $ 26))
                                                  (QREFELT $ 27))
                                        (QREFELT $ 28))
                              . #2#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20))
                              . #2#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 22)
                                     (QREFELT $ 24))
                           (|error|
                            "inverse of series with many leading zero coefficients")))))))))
               (LETT |xOpList| (|FS2UPS;opsInvolvingX| |coef| $) . #2#)
               (EXIT
                (COND
                 ((NULL |xOpList|)
                  (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 68))))
                 (#3#
                  (SEQ
                   (COND
                    ((NULL (CDR |xOpList|))
                     (COND
                      ((SPADCALL (|SPADfirst| |xOpList|) '|log|
                                 (QREFELT $ 202))
                       (EXIT (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 68))))))))
                   (EXIT
                    (COND
                     ((|FS2UPS;productOfNonZeroes?| |coef| $)
                      (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 68))))
                     (#3#
                      (|FS2UPS;stateProblem| "inv"
                       "lowest order coefficient involves x" $)))))))))))))))) 

(DEFUN |FS2UPS;kernelToGenUPS| (|ker| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G2532 |n| |arg| |args| |sym|)
    (RETURN
     (SEQ
      (LETT |sym| (SPADCALL |ker| (QREFELT $ 126))
            . #2=(|FS2UPS;kernelToGenUPS|))
      (EXIT
       (COND
        ((QEQCAR |sym| 0)
         (COND
          ((EQUAL (QCDR |sym|) (QREFELT $ 13))
           (CONS 0
                 (SPADCALL (|spadConstant| $ 18) (|spadConstant| $ 96)
                           (QREFELT $ 61))))
          (#3='T
           (CONS 0
                 (SPADCALL (SPADCALL |ker| (QREFELT $ 128))
                           (|spadConstant| $ 66) (QREFELT $ 61))))))
        ((NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 129)) . #2#))
         (CONS 0
               (SPADCALL (SPADCALL |ker| (QREFELT $ 128)) (|spadConstant| $ 66)
                         (QREFELT $ 61))))
        ((NULL (CDR |args|))
         (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
              (EXIT
               (COND
                ((SPADCALL |ker| '|abs| (QREFELT $ 131))
                 (|FS2UPS;nthRootToGenUPS|
                  (SPADCALL |arg| |arg| (QREFELT $ 132)) 2 |posCheck?|
                  |atanFlag| $))
                ((SPADCALL |ker| '|%paren| (QREFELT $ 131))
                 (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| '|log| (QREFELT $ 131))
                 (|FS2UPS;logToGenUPS| |arg| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| '|exp| (QREFELT $ 131))
                 (|FS2UPS;expToGenUPS| |arg| |posCheck?| |atanFlag| $))
                (#3#
                 (|FS2UPS;tranToGenUPS| |ker| |arg| |posCheck?| |atanFlag|
                  $))))))
        ((SPADCALL |ker| '|%power| (QREFELT $ 131))
         (|FS2UPS;powToGenUPS| |args| |posCheck?| |atanFlag| $))
        ((SPADCALL |ker| '|nthRoot| (QREFELT $ 131))
         (SEQ
          (LETT |n|
                (SPADCALL (SPADCALL |args| (QREFELT $ 134)) (QREFELT $ 135))
                . #2#)
          (EXIT
           (|FS2UPS;nthRootToGenUPS| (|SPADfirst| |args|)
            (PROG1 (LETT #1# |n| . #2#)
              (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))
            |posCheck?| |atanFlag| $))))
        (#3#
         (|FS2UPS;stateProblem|
          (SPADCALL (SPADCALL |ker| (QREFELT $ 115)) (QREFELT $ 117))
          "unknown kernel" $)))))))) 

(DEFUN |FS2UPS;nthRootToGenUPS| (|arg| |n| |posCheck?| |atanFlag| $)
  (PROG (|ans| |result|)
    (RETURN
     (SEQ
      (LETT |result| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
            . #1=(|FS2UPS;nthRootToGenUPS|))
      (EXIT
       (COND ((QEQCAR |result| 1) |result|)
             (#2='T
              (SEQ
               (LETT |ans|
                     (|FS2UPS;carefulNthRootIfCan| (CDR |result|) |n|
                      |posCheck?| 'T $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |ans| 1) |ans|)
                      (#2# (CONS 0 (CDR |ans|))))))))))))) 

(DEFUN |FS2UPS;logToGenUPS| (|arg| |posCheck?| |atanFlag| $)
  (PROG (|logTerm| |term1| |pow| |mon| |negRat?| |rat| |cen| |lt| #1=#:G2568
         #2=#:G2570 |signum| |coef| |deg| |ups| #3=#:G2058 |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
              . #4=(|FS2UPS;logToGenUPS|))
        (EXIT
         (COND ((QEQCAR |result| 1) |result|)
               (#5='T
                (SEQ
                 (EXIT
                  (SEQ
                   (LETT |ups|
                         (PROG2
                             (LETT #3# |result| . #4#)
                             (QCDR #3#)
                           (|check-union| (QEQCAR #3# 0) (QREFELT $ 9) #3#))
                         . #4#)
                   (LETT |deg| (SPADCALL |ups| (QREFELT $ 19)) . #4#)
                   (SEQ
                    (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20)) . #4#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 22) (QREFELT $ 24))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 14)
                                                            (QREFELT $ 26))
                                                  (QREFELT $ 27))
                                        (QREFELT $ 28))
                              . #4#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 20))
                              . #4#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 22)
                                     (QREFELT $ 24))
                           (|error|
                            "log of series with many leading zero coefficients")))))))))
                   (COND
                    (|posCheck?|
                     (SEQ
                      (LETT |signum| (SPADCALL |coef| (QREFELT $ 32)) . #4#)
                      (EXIT
                       (COND
                        ((QEQCAR |signum| 0)
                         (COND
                          ((EQL (QCDR |signum|) -1)
                           (PROGN
                            (LETT #1#
                                  (PROGN
                                   (LETT #2#
                                         (|FS2UPS;stateProblem| "log"
                                          "negative leading coefficient" $)
                                         . #4#)
                                   (GO #2#))
                                  . #4#)
                            (GO #1#))))))))))
                   (LETT |lt| (SPADCALL |coef| |deg| (QREFELT $ 61)) . #4#)
                   (LETT |cen| (SPADCALL |lt| (QREFELT $ 203)) . #4#)
                   (LETT |negRat?|
                         (SEQ (LETT |rat| (|FS2UPS;ratIfCan| |coef| $) . #4#)
                              (EXIT
                               (COND
                                ((QEQCAR |rat| 0)
                                 (COND
                                  ((SPADCALL (QCDR |rat|)
                                             (|spadConstant| $ 204)
                                             (QREFELT $ 205))
                                   'T)
                                  (#5# 'NIL)))
                                (#5# 'NIL))))
                         . #4#)
                   (LETT |logTerm|
                         (SEQ
                          (LETT |mon|
                                (SPADCALL
                                 (SPADCALL (QREFELT $ 13) (QREFELT $ 81)) |cen|
                                 (QREFELT $ 150))
                                . #4#)
                          (LETT |pow|
                                (SPADCALL |mon|
                                          (SPADCALL |deg| (QREFELT $ 143))
                                          (QREFELT $ 206))
                                . #4#)
                          (EXIT
                           (COND
                            (|negRat?|
                             (SPADCALL (SPADCALL |coef| |pow| (QREFELT $ 132))
                                       (QREFELT $ 207)))
                            (#5#
                             (SEQ
                              (LETT |term1|
                                    (SPADCALL (SPADCALL |deg| (QREFELT $ 143))
                                              (SPADCALL |mon| (QREFELT $ 207))
                                              (QREFELT $ 132))
                                    . #4#)
                              (EXIT
                               (SPADCALL (SPADCALL |coef| (QREFELT $ 207))
                                         |term1| (QREFELT $ 89))))))))
                         . #4#)
                   (EXIT
                    (CONS 0
                          (SPADCALL
                           (SPADCALL |logTerm| (|spadConstant| $ 66)
                                     (QREFELT $ 61))
                           (SPADCALL (SPADCALL |ups| |lt| (QREFELT $ 154))
                                     (QREFELT $ 208))
                           (QREFELT $ 50))))))
                 #1# (EXIT #1#)))))))
      #2# (EXIT #2#))))) 

(DEFUN |FS2UPS;expToGenUPS| (|arg| |posCheck?| |atanFlag| $)
  (PROG (|ups|)
    (RETURN
     (SEQ
      (LETT |ups| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
            |FS2UPS;expToGenUPS|)
      (EXIT
       (COND ((QEQCAR |ups| 1) |ups|)
             ('T
              (|FS2UPS;expGenUPS| (CDR |ups|) |posCheck?| |atanFlag| $)))))))) 

(DEFUN |FS2UPS;expGenUPS| (|ups| |posCheck?| |atanFlag| $)
  (PROG (|result| |expCoef| |xOpList| |lc| |deg|)
    (RETURN
     (SEQ
      (LETT |deg| (SPADCALL |ups| (|spadConstant| $ 96) (QREFELT $ 28))
            . #1=(|FS2UPS;expGenUPS|))
      (EXIT
       (COND
        ((SPADCALL |deg| (|spadConstant| $ 66) (QREFELT $ 74))
         (|FS2UPS;stateProblem| "exp" "essential singularity" $))
        ((SPADCALL (|spadConstant| $ 66) |deg| (QREFELT $ 74))
         (CONS 0 (SPADCALL |ups| (QREFELT $ 209))))
        (#2='T
         (SEQ
          (LETT |lc| (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 20))
                . #1#)
          (LETT |xOpList| (|FS2UPS;opsInvolvingX| |lc| $) . #1#)
          (COND
           ((NULL (|FS2UPS;opInOpList?| '|log| |xOpList| $))
            (EXIT (CONS 0 (SPADCALL |ups| (QREFELT $ 209))))))
          (LETT |expCoef|
                (SPADCALL (SPADCALL |lc| (QREFELT $ 186)) (QREFELT $ 13)
                          (QREFELT $ 211))
                . #1#)
          (EXIT
           (COND
            ((|FS2UPS;opInOpList?| '|log| (|FS2UPS;opsInvolvingX| |expCoef| $)
              $)
             (|FS2UPS;stateProblem| "exp" "logs in constant coefficient" $))
            (#2#
             (SEQ
              (LETT |result|
                    (SPADCALL |expCoef| |posCheck?| |atanFlag| (QREFELT $ 196))
                    . #1#)
              (EXIT
               (COND ((QEQCAR |result| 1) |result|)
                     (#2#
                      (CONS 0
                            (SPADCALL (CDR |result|)
                                      (SPADCALL
                                       (SPADCALL |ups|
                                                 (SPADCALL |lc|
                                                           (|spadConstant| $
                                                                           66)
                                                           (QREFELT $ 61))
                                                 (QREFELT $ 75))
                                       (QREFELT $ 209))
                                      (QREFELT $ 53)))))))))))))))))) 

(DEFUN |FS2UPS;atancotToGenUPS|
       (|fe| |arg| |posCheck?| |atanFlag| |plusMinus| $)
  (PROG (|cc| |n| |left?| |posNegPi2| |signum| |lc| #1=#:G2615 |rn| #2=#:G2613
         |yCoef| |y| |ord| |coef| |ups| #3=#:G2058 |trouble| |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
              . #4=(|FS2UPS;atancotToGenUPS|))
        (EXIT
         (COND
          ((QEQCAR |result| 1)
           (SEQ (LETT |trouble| (CDR |result|) . #4#)
                (EXIT
                 (COND
                  ((EQUAL (QCDR |trouble|) "essential singularity")
                   (CONS 0
                         (SPADCALL |fe| (|spadConstant| $ 66) (QREFELT $ 61))))
                  (#5='T |result|)))))
          (#5#
           (SEQ
            (EXIT
             (SEQ
              (LETT |ups|
                    (PROG2
                        (LETT #3# |result| . #4#)
                        (QCDR #3#)
                      (|check-union| (QEQCAR #3# 0) (QREFELT $ 9) #3#))
                    . #4#)
              (LETT |coef|
                    (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 20))
                    . #4#)
              (SEQ
               (LETT |ord|
                     (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 28))
                     . #4#)
               (EXIT
                (COND
                 ((SPADCALL |ord| (|spadConstant| $ 66) (QREFELT $ 141))
                  (COND
                   ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 132))
                              (SPADCALL (|spadConstant| $ 18) (QREFELT $ 118))
                              (QREFELT $ 24))
                    (PROGN
                     (LETT #2#
                           (SEQ
                            (LETT |y|
                                  (SPADCALL (SPADCALL |ups| (QREFELT $ 152))
                                            (SPADCALL (|spadConstant| $ 52)
                                                      (SPADCALL |ups| |ups|
                                                                (QREFELT $ 53))
                                                      (QREFELT $ 50))
                                            (QREFELT $ 154))
                                  . #4#)
                            (LETT |yCoef|
                                  (SPADCALL |y|
                                            (SPADCALL (|spadConstant| $ 96)
                                                      (QREFELT $ 212))
                                            (QREFELT $ 20))
                                  . #4#)
                            (EXIT
                             (CONS 0
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |yCoef| (QREFELT $ 207))
                                     (|spadConstant| $ 66) (QREFELT $ 61))
                                    (SPADCALL
                                     (SPADCALL |y|
                                               (SPADCALL |yCoef|
                                                         (SPADCALL
                                                          (|spadConstant| $ 96)
                                                          (QREFELT $ 212))
                                                         (QREFELT $ 61))
                                               (QREFELT $ 75))
                                     (QREFELT $ 155))
                                    (QREFELT $ 50)))))
                           . #4#)
                     (GO #2#))))))))
              (LETT |cc|
                    (COND
                     ((SPADCALL |ord| (|spadConstant| $ 66) (QREFELT $ 74))
                      (COND
                       ((SPADCALL |atanFlag| (CONS 0 "complex")
                                  (QREFELT $ 142))
                        (PROGN
                         (LETT #1#
                               (|FS2UPS;stateProblem| "atan"
                                "essential singularity" $)
                               . #4#)
                         (GO #1#)))
                       (#5#
                        (SEQ
                         (LETT |rn|
                               (|FS2UPS;ratIfCan|
                                (SPADCALL |ord| (QREFELT $ 143)) $)
                               . #4#)
                         (EXIT
                          (COND
                           ((QEQCAR |rn| 1)
                            (PROGN
                             (LETT #1#
                                   (|FS2UPS;stateProblem| "atan"
                                    "branch problem" $)
                                   . #4#)
                             (GO #1#)))
                           (#5#
                            (SEQ
                             (COND
                              ((SPADCALL |atanFlag| (CONS 1 "real: two sides")
                                         (QREFELT $ 142))
                               (COND
                                ((ODDP (SPADCALL (QCDR |rn|) (QREFELT $ 145)))
                                 (PROGN
                                  (LETT #1#
                                        (|FS2UPS;stateProblem| "atan"
                                         "branch problem" $)
                                        . #4#)
                                  (GO #1#))))))
                             (LETT |lc| (SPADCALL |ups| |ord| (QREFELT $ 20))
                                   . #4#)
                             (LETT |signum| (SPADCALL |lc| (QREFELT $ 32))
                                   . #4#)
                             (EXIT
                              (COND
                               ((QEQCAR |signum| 1)
                                (COND
                                 ((SPADCALL |atanFlag| (CONS 4 "just do it")
                                            (QREFELT $ 142))
                                  (COND
                                   ((EQL |plusMinus| 1)
                                    (SPADCALL (SPADCALL (QREFELT $ 146))
                                              (SPADCALL 2 (QREFELT $ 149))
                                              (QREFELT $ 140)))
                                   (#5# (|spadConstant| $ 22))))
                                 (#5#
                                  (SEQ
                                   (LETT |posNegPi2|
                                         (SPADCALL
                                          (SPADCALL
                                           (|FS2UPS;signOfExpression| |lc| $)
                                           (SPADCALL (QREFELT $ 146))
                                           (QREFELT $ 132))
                                          (SPADCALL 2 (QREFELT $ 149))
                                          (QREFELT $ 140))
                                         . #4#)
                                   (EXIT
                                    (COND ((EQL |plusMinus| 1) |posNegPi2|)
                                          (#5#
                                           (SPADCALL
                                            (SPADCALL
                                             (SPADCALL (QREFELT $ 146))
                                             (SPADCALL 2 (QREFELT $ 149))
                                             (QREFELT $ 140))
                                            |posNegPi2| (QREFELT $ 150)))))))))
                               (#5#
                                (SEQ
                                 (LETT |left?|
                                       (SPADCALL |atanFlag|
                                                 (CONS 2 "real: left side")
                                                 (QREFELT $ 142))
                                       . #4#)
                                 (LETT |n| (QCDR |signum|) . #4#)
                                 (COND
                                  (|left?|
                                   (COND
                                    ((EQL |n| 1)
                                     (EXIT
                                      (COND
                                       ((EQL |plusMinus| 1)
                                        (SPADCALL
                                         (SPADCALL (SPADCALL (QREFELT $ 146))
                                                   (SPADCALL 2 (QREFELT $ 149))
                                                   (QREFELT $ 140))
                                         (QREFELT $ 118)))
                                       (#5# (SPADCALL (QREFELT $ 146))))))
                                    ((NULL |left?|)
                                     (COND
                                      ((EQL |n| -1)
                                       (EXIT
                                        (COND
                                         ((EQL |plusMinus| 1)
                                          (SPADCALL
                                           (SPADCALL (SPADCALL (QREFELT $ 146))
                                                     (SPADCALL 2
                                                               (QREFELT $ 149))
                                                     (QREFELT $ 140))
                                           (QREFELT $ 118)))
                                         (#5#
                                          (SPADCALL (QREFELT $ 146))))))))))
                                  ((EQL |n| -1)
                                   (EXIT
                                    (COND
                                     ((EQL |plusMinus| 1)
                                      (SPADCALL
                                       (SPADCALL (SPADCALL (QREFELT $ 146))
                                                 (SPADCALL 2 (QREFELT $ 149))
                                                 (QREFELT $ 140))
                                       (QREFELT $ 118)))
                                     (#5# (SPADCALL (QREFELT $ 146)))))))
                                 (EXIT
                                  (COND
                                   ((EQL |plusMinus| 1)
                                    (SPADCALL (SPADCALL (QREFELT $ 146))
                                              (SPADCALL 2 (QREFELT $ 149))
                                              (QREFELT $ 140)))
                                   (#5# (|spadConstant| $ 22))))))))))))))))
                     (#5# (SPADCALL |coef| (QREFELT $ 151))))
                    . #4#)
              (EXIT
               (CONS 0
                     (SPADCALL (SPADCALL |cc| (QREFELT $ 73))
                               (SPADCALL
                                (SPADCALL (SPADCALL |ups| (QREFELT $ 152))
                                          (SPADCALL (|spadConstant| $ 52)
                                                    (SPADCALL |ups| |ups|
                                                              (QREFELT $ 53))
                                                    (QREFELT $ 50))
                                          (QREFELT $ 154))
                                (QREFELT $ 155))
                               (QREFELT $ 50))))))
            #2# (EXIT #2#)))))))
      #1# (EXIT #1#))))) 

(DEFUN |FS2UPS;genUPSApplyIfCan|
       (|fcn| |arg| |fcnName| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G2623 |xOpList| |lc| |deg| |ups| #2=#:G2058 |series|)
    (RETURN
     (SEQ
      (LETT |series| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
            . #3=(|FS2UPS;genUPSApplyIfCan|))
      (EXIT
       (COND ((QEQCAR |series| 1) |series|)
             (#4='T
              (SEQ
               (LETT |ups|
                     (PROG2
                         (LETT #2# |series| . #3#)
                         (QCDR #2#)
                       (|check-union| (QEQCAR #2# 0) (QREFELT $ 9) #2#))
                     . #3#)
               (LETT |deg|
                     (SPADCALL |ups| (|spadConstant| $ 96) (QREFELT $ 28))
                     . #3#)
               (EXIT
                (COND
                 ((SPADCALL |deg| (|spadConstant| $ 66) (QREFELT $ 74))
                  (|FS2UPS;stateProblem| |fcnName| "essential singularity" $))
                 ((SPADCALL (|spadConstant| $ 66) |deg| (QREFELT $ 74))
                  (CONS 0
                        (PROG2
                            (LETT #1# (SPADCALL |ups| |fcn|) . #3#)
                            (QCDR #1#)
                          (|check-union| (QEQCAR #1# 0) (QREFELT $ 9) #1#))))
                 (#4#
                  (SEQ
                   (LETT |lc|
                         (SPADCALL |ups| (|spadConstant| $ 66) (QREFELT $ 20))
                         . #3#)
                   (LETT |xOpList| (|FS2UPS;opsInvolvingX| |lc| $) . #3#)
                   (EXIT
                    (COND
                     ((NULL |xOpList|)
                      (CONS 0
                            (PROG2
                                (LETT #1# (SPADCALL |ups| |fcn|) . #3#)
                                (QCDR #1#)
                              (|check-union| (QEQCAR #1# 0) (QREFELT $ 9)
                                             #1#))))
                     ((|FS2UPS;opInOpList?| '|log| |xOpList| $)
                      (|FS2UPS;stateProblem| |fcnName|
                       "logs in constant coefficient" $))
                     ((|FS2UPS;contOnReals?| |fcnName| $)
                      (CONS 0
                            (PROG2
                                (LETT #1# (SPADCALL |ups| |fcn|) . #3#)
                                (QCDR #1#)
                              (|check-union| (QEQCAR #1# 0) (QREFELT $ 9)
                                             #1#))))
                     (#4#
                      (|FS2UPS;stateProblem| |fcnName|
                       "x in constant coefficient" $)))))))))))))))) 

(DEFUN |FS2UPS;applyBddIfCan|
       (|fe| |fcn| |arg| |fcnName| |posCheck?| |atanFlag| $)
  (PROG (|ans| |trouble| |ups|)
    (RETURN
     (SEQ
      (LETT |ups| (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $)
            . #1=(|FS2UPS;applyBddIfCan|))
      (EXIT
       (COND
        ((QEQCAR |ups| 1)
         (SEQ (LETT |trouble| (CDR |ups|) . #1#)
              (EXIT
               (COND
                ((EQUAL (QCDR |trouble|) "essential singularity")
                 (CONS 0 (SPADCALL |fe| (|spadConstant| $ 66) (QREFELT $ 61))))
                (#2='T |ups|)))))
        (#2#
         (SEQ (LETT |ans| (SPADCALL (CDR |ups|) |fcn|) . #1#)
              (EXIT
               (COND
                ((QEQCAR |ans| 1)
                 (CONS 0 (SPADCALL |fe| (|spadConstant| $ 66) (QREFELT $ 61))))
                (#2# (CONS 0 (QCDR |ans|))))))))))))) 

(DEFUN |FS2UPS;tranToGenUPS| (|ker| |arg| |posCheck?| |atanFlag| $)
  (COND
   ((SPADCALL |ker| '|sin| (QREFELT $ 131))
    (|FS2UPS;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 128)) (ELT $ 156) |arg|
     "sin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|cos| (QREFELT $ 131))
    (|FS2UPS;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 128)) (ELT $ 157) |arg|
     "cos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| '|asin| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 162) |arg| "asin" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|acos| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 163) |arg| "acos" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|atan| (QREFELT $ 131))
    (|FS2UPS;atancotToGenUPS| (SPADCALL |ker| (QREFELT $ 128)) |arg|
     |posCheck?| |atanFlag| 1 $))
   ((SPADCALL |ker| '|acot| (QREFELT $ 131))
    (|FS2UPS;atancotToGenUPS| (SPADCALL |ker| (QREFELT $ 128)) |arg|
     |posCheck?| |atanFlag| -1 $))
   ((SPADCALL |ker| '|asec| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 164) |arg| "asec" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|acsc| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 165) |arg| "acsc" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|asinh| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 172) |arg| "asinh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|acosh| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 173) |arg| "acosh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|atanh| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 174) |arg| "atanh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|acoth| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 175) |arg| "acoth" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|asech| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 176) |arg| "asech" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| '|acsch| (QREFELT $ 131))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 177) |arg| "acsch" |posCheck?| |atanFlag|
     $))
   ('T
    (|FS2UPS;stateProblem|
     (SPADCALL (SPADCALL |ker| (QREFELT $ 115)) (QREFELT $ 117))
     "unknown kernel" $)))) 

(DEFUN |FS2UPS;powToGenUPS| (|args| |posCheck?| |atanFlag| $)
  (PROG (|expon| |logBase|)
    (RETURN
     (SEQ
      (LETT |logBase|
            (|FS2UPS;logToGenUPS| (|SPADfirst| |args|) |posCheck?| |atanFlag|
             $)
            . #1=(|FS2UPS;powToGenUPS|))
      (EXIT
       (COND ((QEQCAR |logBase| 1) |logBase|)
             (#2='T
              (SEQ
               (LETT |expon|
                     (|FS2UPS;iExprToGenUPS| (SPADCALL |args| (QREFELT $ 134))
                      |posCheck?| |atanFlag| $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |expon| 1) |expon|)
                      (#2#
                       (|FS2UPS;expGenUPS|
                        (SPADCALL (CDR |expon|) (CDR |logBase|) (QREFELT $ 53))
                        |posCheck?| |atanFlag| $)))))))))))) 

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

(DEFUN |FunctionSpaceToUnivariatePowerSeries;|
       (|#1| |#2| |#3| |#4| |#5| |#6| |#7| |#8|)
  (PROG (|pv$| $ |dv$| DV$8 DV$7 DV$6 DV$5 DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|)
            . #1=(|FunctionSpaceToUnivariatePowerSeries|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT DV$5 (|devaluate| |#5|) . #1#)
      (LETT DV$6 (|devaluate| |#6|) . #1#)
      (LETT DV$7 (|devaluate| |#7|) . #1#)
      (LETT DV$8 (|devaluate| |#8|) . #1#)
      (LETT |dv$|
            (LIST '|FunctionSpaceToUnivariatePowerSeries| DV$1 DV$2 DV$3 DV$4
                  DV$5 DV$6 DV$7 DV$8)
            . #1#)
      (LETT $ (GETREFV 213) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|FunctionSpaceToUnivariatePowerSeries|
                  (LIST DV$1 DV$2 DV$3 DV$4 DV$5 DV$6 DV$7 DV$8) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10 |#5|)
      (QSETREFV $ 11 |#6|)
      (QSETREFV $ 12 |#7|)
      (QSETREFV $ 13 |#8|)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 14 1000)
      (QSETREFV $ 69 (|EllipticFunctionsUnivariateTaylorSeries| |#2| |#6|))
      (COND
       ((|HasSignature| |#2|
                        (LIST '|abs|
                              (LIST (|devaluate| |#2|) (|devaluate| |#2|))))
        (QSETREFV $ 138
                  (CONS (|dispatchFunction| |FS2UPS;localAbs;2FE;27|) $)))
       ('T
        (QSETREFV $ 138
                  (CONS (|dispatchFunction| |FS2UPS;localAbs;2FE;28|) $))))
      (QSETREFV $ 192
                (LIST #2="sin" #3="cos" #4="atan" #5="acot" "exp" "asinh"))
      (QSETREFV $ 193 (LIST #2# #3# #4# #5#))
      $)))) 

(MAKEPROP '|FunctionSpaceToUnivariatePowerSeries| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|local| |#5|) (|local| |#6|)
              (|local| |#7|) (|local| |#8|) 'ZEROCOUNT
              (|Union| 144 '#1="failed") (0 . |retractIfCan|) (5 . |One|)
              (9 . |One|) (13 . |degree|) (18 . |coefficient|) (24 . |Zero|)
              (28 . |Zero|) (|Boolean|) (32 . =) (|Integer|) (38 . |coerce|)
              (43 . +) (49 . |order|) (55 . |even?|) (|Union| 25 '"failed")
              (|ElementaryFunctionSign| 6 7) (60 . |sign|) (65 . |zero?|)
              (|Union| 9 '"failed") (|NonNegativeInteger|)
              (70 . |nthRootIfCan|) (|Union| 41 '#1#) (76 . |retractIfCan|)
              (|SparseUnivariatePolynomial| $) (|Symbol|) (|Polynomial| 6)
              (81 . |univariate|) (|Union| 108 '#2="failed") (87 . |isPlus|)
              (|Record| (|:| |func| 116) (|:| |prob| 116))
              (|Union| (|:| |%series| 9) (|:| |%problem| 45))
              (|Union| '"complex" '"real: two sides" '"real: left side"
                       '"real: right side" '"just do it")
              |FS2UPS;exprToUPS;FEBUU;4| (92 . |Zero|) (96 . +)
              (102 . |isTimes|) (107 . |One|) (111 . *) (|Union| 127 '#1#)
              (117 . |retractIfCan|) (|SparseUnivariatePolynomial| 41)
              (122 . |zero?|) (127 . |degree|) (132 . |leadingCoefficient|)
              (137 . |coerce|) (142 . |monomial|) (148 . |reductum|)
              (|Record| (|:| |val| $) (|:| |exponent| 25)) (|Union| 63 '#2#)
              (153 . |isPower|) (158 . |Zero|) (162 . |Zero|) (166 . ^) 'ELITS
              (|List| 40) (172 . |variables|) (177 . |member?|)
              (183 . |coerce|) (188 . <) (194 . -) (200 . |differentiate|)
              (|List| 9) (|Mapping| 7 7) (|List| 78) (206 . |taylorviaderiv|)
              (213 . |coerce|) (|Equation| 7) (218 . =) (|List| 112)
              (224 . |eval|) (230 . |map|) (236 . |taylorviaderiv|)
              (243 . |new|) (247 . +) (253 . |elt|) (|Mapping| 11 11)
              (259 . |applyTaylor|) (265 . |One|) (|List| 7) (269 . |elt|)
              (275 . |One|) (|PositiveInteger|) (279 . ^) (285 . *) (291 . -)
              (296 . |coerce|) (301 . |coerce|) (306 . /) (312 . |last|)
              (|BasicOperator|) (|Kernel| 7) (317 . |operator|) (|List| $)
              (322 . |kernel|) (328 . -) (333 . ^) (|Equation| $)
              (339 . |eval|) (345 . |taylorvialode|) (352 . |name|) (|String|)
              (357 . |string|) (362 . -) (367 . |jacobiSn|) (373 . |jacobiCn|)
              (379 . |jacobiDn|) (385 . |ellipticE|) (391 . |ellipticF|)
              (397 . |ellipticPi|) (|Union| 40 '"failed") (404 . |symbolIfCan|)
              (|Kernel| $) (409 . |coerce|) (414 . |argument|) (419 . |has?|)
              (425 . |is?|) (431 . *) (437 . |expIfCan|) (442 . |second|)
              (447 . |retract|) (452 . |logIfCan|) (457 . |abs|)
              (462 . |localAbs|) (467 . |sqrt|) (472 . /) (478 . =) (484 . =)
              (490 . |coerce|) (|Fraction| 25) (495 . |numer|) (500 . |pi|)
              (504 . |pi|) (508 . |pi|) (512 . |coerce|) (517 . -)
              (523 . |atan|) (528 . |differentiate|) (533 . *) (539 . /)
              (545 . |integrate|) (550 . |sinIfCan|) (555 . |cosIfCan|)
              (560 . |tanIfCan|) (565 . |cotIfCan|) (570 . |secIfCan|)
              (575 . |cscIfCan|) (580 . |asinIfCan|) (585 . |acosIfCan|)
              (590 . |asecIfCan|) (595 . |acscIfCan|) (600 . |sinhIfCan|)
              (605 . |coshIfCan|) (610 . |tanhIfCan|) (615 . |cothIfCan|)
              (620 . |sechIfCan|) (625 . |cschIfCan|) (630 . |asinhIfCan|)
              (635 . |acoshIfCan|) (640 . |atanhIfCan|) (645 . |acothIfCan|)
              (650 . |asechIfCan|) (655 . |acschIfCan|)
              (|SparseMultivariatePolynomial| 6 127) (660 . |numer|)
              (665 . |denom|) (|Mapping| 7 106) (|Mapping| 7 6)
              (|SparseMultivariatePolynomial| 6 106)
              (|PolynomialCategoryLifting| (|IndexedExponents| 106) 106 6 183
                                           7)
              (670 . |map|) (677 . |exp|) (682 . |inv|) (687 . |sin|)
              (692 . |cos|) (697 . *) (703 . |elt|) 'CONTFCNS 'BDDFCNS
              (|List| 116) (709 . |member?|) |FS2UPS;exprToGenUPS;FEBUU;39|
              (|List| 127) (715 . |tower|) (720 . |unary?|) (|List| 105)
              (725 . |removeDuplicates|) (730 . |is?|) (736 . |center|)
              (741 . |Zero|) (745 . <) (751 . ^) (757 . |log|) (762 . |log|)
              (767 . |exp|) (|ElementaryFunctionStructurePackage| 6 7)
              (772 . |normalize|) (778 . -))
           '#(|localAbs| 783 |exprToUPS| 788 |exprToGenUPS| 795) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 212
                                                 '(1 7 15 0 16 0 6 0 17 0 7 0
                                                   18 1 9 8 0 19 2 9 7 0 8 20 0
                                                   6 0 21 0 7 0 22 2 7 23 0 0
                                                   24 1 8 0 25 26 2 8 0 0 0 27
                                                   2 9 8 0 8 28 1 25 23 0 29 1
                                                   31 30 7 32 1 8 23 0 33 2 10
                                                   34 9 35 36 1 7 37 0 38 2 41
                                                   39 0 40 42 1 7 43 0 44 0 9 0
                                                   49 2 9 0 0 0 50 1 7 43 0 51
                                                   0 9 0 52 2 9 0 0 0 53 1 7 54
                                                   0 55 1 56 23 0 57 1 56 35 0
                                                   58 1 56 41 0 59 1 7 0 41 60
                                                   2 9 0 7 8 61 1 56 0 0 62 1 7
                                                   64 0 65 0 8 0 66 0 11 0 67 2
                                                   9 0 0 25 68 1 7 70 0 71 2 70
                                                   23 40 0 72 1 9 0 7 73 2 8 23
                                                   0 0 74 2 9 0 0 0 75 2 7 0 0
                                                   40 76 3 12 9 9 77 79 80 1 7
                                                   0 40 81 2 82 0 7 7 83 2 7 0
                                                   0 84 85 2 9 0 78 0 86 3 12 9
                                                   7 77 79 87 0 40 0 88 2 7 0 0
                                                   0 89 2 77 9 0 25 90 2 12 9
                                                   91 9 92 0 25 0 93 2 94 7 0
                                                   25 95 0 8 0 96 2 9 0 0 97 98
                                                   2 9 0 97 0 99 1 9 0 0 100 1
                                                   6 0 25 101 1 7 0 6 102 2 9 0
                                                   0 7 103 1 94 7 0 104 1 106
                                                   105 0 107 2 7 0 105 108 109
                                                   1 6 0 0 110 2 9 0 0 0 111 2
                                                   7 0 0 112 113 3 12 9 77 9 94
                                                   114 1 106 40 0 115 1 40 116
                                                   0 117 1 7 0 0 118 2 69 11 11
                                                   7 119 2 69 11 11 7 120 2 69
                                                   11 11 7 121 2 69 11 11 7 122
                                                   2 69 11 11 7 123 3 69 11 11
                                                   7 7 124 1 106 125 0 126 1 7
                                                   0 127 128 1 106 94 0 129 2
                                                   105 23 0 40 130 2 106 23 0
                                                   40 131 2 7 0 0 0 132 1 10 34
                                                   9 133 1 94 7 0 134 1 7 25 0
                                                   135 1 10 34 9 136 1 7 0 0
                                                   137 1 0 7 7 138 1 7 0 0 139
                                                   2 7 0 0 0 140 2 8 23 0 0 141
                                                   2 47 23 0 0 142 1 7 0 8 143
                                                   1 144 25 0 145 0 7 0 146 0 9
                                                   0 147 0 11 0 148 1 7 0 25
                                                   149 2 7 0 0 0 150 1 7 0 0
                                                   151 1 9 0 0 152 2 9 0 25 0
                                                   153 2 9 0 0 0 154 1 9 0 0
                                                   155 1 10 34 9 156 1 10 34 9
                                                   157 1 10 34 9 158 1 10 34 9
                                                   159 1 10 34 9 160 1 10 34 9
                                                   161 1 10 34 9 162 1 10 34 9
                                                   163 1 10 34 9 164 1 10 34 9
                                                   165 1 10 34 9 166 1 10 34 9
                                                   167 1 10 34 9 168 1 10 34 9
                                                   169 1 10 34 9 170 1 10 34 9
                                                   171 1 10 34 9 172 1 10 34 9
                                                   173 1 10 34 9 174 1 10 34 9
                                                   175 1 10 34 9 176 1 10 34 9
                                                   177 1 7 178 0 179 1 7 178 0
                                                   180 3 184 7 181 182 183 185
                                                   1 7 0 0 186 1 7 0 0 187 1 7
                                                   0 0 188 1 7 0 0 189 2 7 0 97
                                                   0 190 2 7 0 105 108 191 2
                                                   194 23 116 0 195 1 7 197 0
                                                   198 1 105 23 0 199 1 200 0 0
                                                   201 2 105 23 0 40 202 1 9 7
                                                   0 203 0 144 0 204 2 144 23 0
                                                   0 205 2 7 0 0 0 206 1 7 0 0
                                                   207 1 9 0 0 208 1 9 0 0 209
                                                   2 210 7 7 40 211 1 8 0 0 212
                                                   1 0 7 7 138 3 0 46 7 23 47
                                                   48 3 0 46 7 23 47 196)))))
           '|lookupComplete|)) 
