
(/VERSIONCHECK 2) 

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

(DEFUN |FS2UPS;carefulNthRootIfCan| (|ups| |n| |posCheck?| |rightOnly?| $)
  (PROG (|ans| #1=#:G793 |signum| |coef| |deg|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((< |n| 1) (|error| "nthRoot: n must be positive"))
             (#2='T
              (SEQ
               (LETT |deg| (SPADCALL |ups| (QREFELT $ 17))
                     . #3=(|FS2UPS;carefulNthRootIfCan|))
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18)) . #3#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 20) (QREFELT $ 22))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 12)
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 25))
                                        (QREFELT $ 26))
                              . #3#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18))
                              . #3#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 20)
                                     (QREFELT $ 22))
                           (|error|
                            "log of series with many leading zero coefficients")))))))))
               (COND
                ((SPADCALL |n| (QREFELT $ 27))
                 (COND
                  (|posCheck?|
                   (SEQ (LETT |signum| (SPADCALL |coef| (QREFELT $ 30)) . #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 $ 31)))
                               (PROGN
                                (LETT #1#
                                      (|FS2UPS;stateProblem| "nth root"
                                       "series of non-zero order" $)
                                      . #3#)
                                (GO #1#))))))))))))))
               (LETT |ans| (SPADCALL |ups| |n| (QREFELT $ 34)) . #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;FEBSU;4| (|fcn| |posCheck?| |atanFlag| $)
  (PROG (|ker| |power| #1=#:G818 |expt| #2=#:G811 |prod| |sum| |poly|)
    (RETURN
     (SEQ
      (LETT |poly| (SPADCALL |fcn| (QREFELT $ 36))
            . #3=(|FS2UPS;exprToUPS;FEBSU;4|))
      (EXIT
       (COND
        ((QEQCAR |poly| 0)
         (CONS 0
               (|FS2UPS;polyToUPS|
                (SPADCALL (QCDR |poly|) (QREFELT $ 11) (QREFELT $ 40)) $)))
        ((QEQCAR (LETT |sum| (SPADCALL |fcn| (QREFELT $ 42)) . #3#) 0)
         (|FS2UPS;listToUPS|
          (PROG2
              (LETT #2# |sum| . #3#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          (ELT $ 46) |posCheck?| |atanFlag| (|spadConstant| $ 47) (ELT $ 48)
          $))
        ((QEQCAR (LETT |prod| (SPADCALL |fcn| (QREFELT $ 49)) . #3#) 0)
         (|FS2UPS;listToUPS|
          (PROG2
              (LETT #2# |prod| . #3#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          (ELT $ 46) |posCheck?| |atanFlag| (|spadConstant| $ 50) (ELT $ 51)
          $))
        ((QEQCAR (LETT |expt| (|FS2UPS;isNonTrivPower| |fcn| $) . #3#) 0)
         (SEQ
          (LETT |power|
                (PROG2
                    (LETT #1# |expt| . #3#)
                    (QCDR #1#)
                  (|check-union| (QEQCAR #1# 0)
                                 (|Record| (|:| |val| (QREFELT $ 7))
                                           (|:| |exponent| (|Integer|)))
                                 #1#))
                . #3#)
          (EXIT
           (|FS2UPS;powerToUPS| (QCAR |power|) (QCDR |power|) |posCheck?|
            |atanFlag| $))))
        (#4='T
         (SEQ (LETT |ker| (SPADCALL |fcn| (QREFELT $ 53)) . #3#)
              (EXIT
               (COND
                ((QEQCAR |ker| 0)
                 (|FS2UPS;kernelToUPS| (QCDR |ker|) |posCheck?| |atanFlag| $))
                (#4#
                 (|error|
                  "exprToUPS: neither a sum, product, power, nor kernel")))))))))))) 

(DEFUN |FS2UPS;polyToUPS| (|poly| $)
  (PROG (|ans| |coef| |deg|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |poly| (QREFELT $ 55)) (|spadConstant| $ 47))
            ('T
             (SEQ
              (LETT |deg| (SPADCALL |poly| (QREFELT $ 56))
                    . #1=(|FS2UPS;polyToUPS|))
              (LETT |coef|
                    (SPADCALL (SPADCALL |poly| (QREFELT $ 57)) (QREFELT $ 58))
                    . #1#)
              (LETT |ans|
                    (SPADCALL |coef| (SPADCALL |deg| (QREFELT $ 24))
                              (QREFELT $ 59))
                    . #1#)
              (LETT |poly| (SPADCALL |poly| (QREFELT $ 60)) . #1#)
              (SEQ G190
                   (COND
                    ((NULL
                      (COND ((SPADCALL |poly| (QREFELT $ 55)) 'NIL) ('T 'T)))
                     (GO G191)))
                   (SEQ (LETT |deg| (SPADCALL |poly| (QREFELT $ 56)) . #1#)
                        (LETT |coef|
                              (SPADCALL (SPADCALL |poly| (QREFELT $ 57))
                                        (QREFELT $ 58))
                              . #1#)
                        (LETT |ans|
                              (SPADCALL |ans|
                                        (SPADCALL |coef|
                                                  (SPADCALL |deg|
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 59))
                                        (QREFELT $ 48))
                              . #1#)
                        (EXIT
                         (LETT |poly| (SPADCALL |poly| (QREFELT $ 60)) . #1#)))
                   NIL (GO G190) G191 (EXIT NIL))
              (EXIT |ans|)))))))) 

(DEFUN |FS2UPS;listToUPS|
       (|list| |feToUPS| |posCheck?| |atanFlag| |ans| |op| $)
  (PROG (#1=#:G846 |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 $ 63))
            . #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=#:G859 |b|)
    (RETURN
     (SEQ
      (LETT |b| (SPADCALL |fcn| |posCheck?| |atanFlag| (QREFELT $ 46))
            . #2=(|FS2UPS;powerToUPS|))
      (EXIT
       (COND ((QEQCAR |b| 1) |b|)
             ((< 0 |n|) (CONS 0 (SPADCALL (CDR |b|) |n| (QREFELT $ 65))))
             ('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 $ 17)) . #2#)
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18)) . #2#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 20) (QREFELT $ 22))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 12)
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 25))
                                        (QREFELT $ 26))
                              . #2#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18))
                              . #2#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 20)
                                     (QREFELT $ 22))
                           (|error|
                            "inverse of series with many leading zero coefficients")))))))))
               (EXIT (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 65)))))))))))) 

(DEFUN |FS2UPS;kernelToUPS| (|ker| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G883 |n| |arg| |args| |sym|)
    (RETURN
     (SEQ
      (LETT |sym| (SPADCALL |ker| (QREFELT $ 68)) . #2=(|FS2UPS;kernelToUPS|))
      (EXIT
       (COND
        ((QEQCAR |sym| 0)
         (COND
          ((EQUAL (QCDR |sym|) (QREFELT $ 11))
           (CONS 0
                 (SPADCALL (|spadConstant| $ 16) (|spadConstant| $ 69)
                           (QREFELT $ 59))))
          (#3='T
           (CONS 0
                 (SPADCALL (SPADCALL |ker| (QREFELT $ 71))
                           (|spadConstant| $ 64) (QREFELT $ 59))))))
        ((OR (NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 73)) . #2#))
             (NULL
              (SPADCALL (QREFELT $ 11)
                        (SPADCALL (SPADCALL |ker| (QREFELT $ 71))
                                  (QREFELT $ 75))
                        (QREFELT $ 76))))
         (CONS 0
               (SPADCALL (SPADCALL |ker| (QREFELT $ 71)) (|spadConstant| $ 64)
                         (QREFELT $ 59))))
        ((NULL (CDR |args|))
         (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
              (EXIT
               (COND
                ((SPADCALL |ker| (SPADCALL "abs" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;nthRootToUPS| (SPADCALL |arg| |arg| (QREFELT $ 79)) 2
                  |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| (SPADCALL "%paren" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 46)))
                ((SPADCALL |ker| (SPADCALL "log" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;logToUPS| |arg| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| (SPADCALL "exp" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;applyIfCan| (ELT $ 80) |arg| "exp" |posCheck?|
                  |atanFlag| $))
                (#3#
                 (|FS2UPS;tranToUPS| |ker| |arg| |posCheck?| |atanFlag| $))))))
        ((SPADCALL |ker| (SPADCALL "%power" (QREFELT $ 77)) (QREFELT $ 78))
         (|FS2UPS;powToUPS| |args| |posCheck?| |atanFlag| $))
        ((SPADCALL |ker| (SPADCALL "nthRoot" (QREFELT $ 77)) (QREFELT $ 78))
         (SEQ
          (LETT |n| (SPADCALL (SPADCALL |args| (QREFELT $ 81)) (QREFELT $ 82))
                . #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 $ 83)) (QREFELT $ 84))
          "unknown kernel" $)))))))) 

(DEFUN |FS2UPS;nthRootToUPS| (|arg| |n| |posCheck?| |atanFlag| $)
  (PROG (|ans| |result|)
    (RETURN
     (SEQ
      (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 46))
            . #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=#:G907 #2=#:G909 #3=#:G911 |signum| |coef| |ups| #4=#:G898
         |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 46))
              . #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| $ 69) (QREFELT $ 26))
                       (QREFELT $ 31)))
                     (EXIT
                      (|FS2UPS;stateProblem| "log" "series of non-zero order"
                       $))))
                   (LETT |coef|
                         (SPADCALL |ups| (|spadConstant| $ 64) (QREFELT $ 18))
                         . #5#)
                   (COND
                    (|posCheck?|
                     (SEQ
                      (LETT |signum| (SPADCALL |coef| (QREFELT $ 30)) . #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 $ 85)) . #5#)
                              (QCDR #1#)
                            (|check-union| (QEQCAR #1# 0) (QREFELT $ 9)
                                           #1#))))))
                 #2# (EXIT #2#)))))))
      #3# (EXIT #3#))))) 

(DEFUN |FS2UPS;localAbs;2FE;12| (|fcn| $) (SPADCALL |fcn| (QREFELT $ 86))) 

(DEFUN |FS2UPS;localAbs;2FE;13| (|fcn| $)
  (SPADCALL (SPADCALL |fcn| |fcn| (QREFELT $ 79)) (QREFELT $ 88))) 

(DEFUN |FS2UPS;signOfExpression| (|arg| $)
  (SPADCALL (SPADCALL |arg| (QREFELT $ 87)) |arg| (QREFELT $ 89))) 

(DEFUN |FS2UPS;atancotToUPS| (|arg| |posCheck?| |atanFlag| |plusMinus| $)
  (PROG (|cc| |n| |left?| |posNegPi2| |signum| |lc| #1=#:G935 |rn| #2=#:G933
         |ord| |coef| |ups| #3=#:G916 |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 46))
              . #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| $ 64) (QREFELT $ 18))
                         . #4#)
                   (SEQ
                    (LETT |ord|
                          (SPADCALL |ups| (|spadConstant| $ 64) (QREFELT $ 26))
                          . #4#)
                    (EXIT
                     (COND
                      ((SPADCALL |ord| (|spadConstant| $ 64) (QREFELT $ 90))
                       (COND
                        ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 79))
                                   (SPADCALL (|spadConstant| $ 16)
                                             (QREFELT $ 91))
                                   (QREFELT $ 22))
                         (PROGN
                          (LETT #2#
                                (PROGN
                                 (LETT #1#
                                       (|FS2UPS;stateProblem| "atan"
                                        "logarithmic singularity" $)
                                       . #4#)
                                 (GO #1#))
                                . #4#)
                          (GO #2#))))))))
                   (LETT |cc|
                         (COND
                          ((SPADCALL |ord| (|spadConstant| $ 64)
                                     (QREFELT $ 92))
                           (COND
                            ((EQUAL |atanFlag| "complex")
                             (PROGN
                              (LETT #1#
                                    (|FS2UPS;stateProblem| "atan"
                                     "essential singularity" $)
                                    . #4#)
                              (GO #1#)))
                            (#5#
                             (SEQ
                              (LETT |rn|
                                    (|FS2UPS;ratIfCan|
                                     (SPADCALL |ord| (QREFELT $ 93)) $)
                                    . #4#)
                              (EXIT
                               (COND
                                ((QEQCAR |rn| 1)
                                 (PROGN
                                  (LETT #1#
                                        (|FS2UPS;stateProblem| "atan"
                                         "branch problem" $)
                                        . #4#)
                                  (GO #1#)))
                                (#5#
                                 (SEQ
                                  (COND
                                   ((EQUAL |atanFlag| "real: two sides")
                                    (COND
                                     ((ODDP
                                       (SPADCALL (QCDR |rn|) (QREFELT $ 95)))
                                      (PROGN
                                       (LETT #1#
                                             (|FS2UPS;stateProblem| "atan"
                                              "branch problem" $)
                                             . #4#)
                                       (GO #1#))))))
                                  (LETT |lc|
                                        (SPADCALL |ups| |ord| (QREFELT $ 18))
                                        . #4#)
                                  (LETT |signum| (SPADCALL |lc| (QREFELT $ 30))
                                        . #4#)
                                  (EXIT
                                   (COND
                                    ((QEQCAR |signum| 1)
                                     (COND
                                      ((EQUAL |atanFlag| "just do it")
                                       (COND
                                        ((EQL |plusMinus| 1)
                                         (SPADCALL (SPADCALL (QREFELT $ 96))
                                                   (SPADCALL 2 (QREFELT $ 98))
                                                   (QREFELT $ 89)))
                                        (#5# (|spadConstant| $ 20))))
                                      (#5#
                                       (SEQ
                                        (LETT |posNegPi2|
                                              (SPADCALL
                                               (SPADCALL
                                                (|FS2UPS;signOfExpression| |lc|
                                                 $)
                                                (SPADCALL (QREFELT $ 96))
                                                (QREFELT $ 79))
                                               (SPADCALL 2 (QREFELT $ 98))
                                               (QREFELT $ 89))
                                              . #4#)
                                        (EXIT
                                         (COND
                                          ((EQL |plusMinus| 1) |posNegPi2|)
                                          (#5#
                                           (SPADCALL
                                            (SPADCALL (SPADCALL (QREFELT $ 96))
                                                      (SPADCALL 2
                                                                (QREFELT $ 98))
                                                      (QREFELT $ 89))
                                            |posNegPi2| (QREFELT $ 99)))))))))
                                    (#5#
                                     (SEQ
                                      (LETT |left?|
                                            (EQUAL |atanFlag|
                                                   "real: left side")
                                            . #4#)
                                      (LETT |n| (QCDR |signum|) . #4#)
                                      (COND
                                       (|left?|
                                        (COND
                                         ((EQL |n| 1)
                                          (EXIT
                                           (COND
                                            ((EQL |plusMinus| 1)
                                             (SPADCALL
                                              (SPADCALL
                                               (SPADCALL (QREFELT $ 96))
                                               (SPADCALL 2 (QREFELT $ 98))
                                               (QREFELT $ 89))
                                              (QREFELT $ 91)))
                                            (#5# (SPADCALL (QREFELT $ 96))))))
                                         ((NULL |left?|)
                                          (COND
                                           ((EQL |n| -1)
                                            (EXIT
                                             (COND
                                              ((EQL |plusMinus| 1)
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL (QREFELT $ 96))
                                                 (SPADCALL 2 (QREFELT $ 98))
                                                 (QREFELT $ 89))
                                                (QREFELT $ 91)))
                                              (#5#
                                               (SPADCALL
                                                (QREFELT $ 96))))))))))
                                       ((EQL |n| -1)
                                        (EXIT
                                         (COND
                                          ((EQL |plusMinus| 1)
                                           (SPADCALL
                                            (SPADCALL (SPADCALL (QREFELT $ 96))
                                                      (SPADCALL 2
                                                                (QREFELT $ 98))
                                                      (QREFELT $ 89))
                                            (QREFELT $ 91)))
                                          (#5# (SPADCALL (QREFELT $ 96)))))))
                                      (EXIT
                                       (COND
                                        ((EQL |plusMinus| 1)
                                         (SPADCALL (SPADCALL (QREFELT $ 96))
                                                   (SPADCALL 2 (QREFELT $ 98))
                                                   (QREFELT $ 89)))
                                        (#5#
                                         (|spadConstant| $ 20))))))))))))))))
                          (#5# (SPADCALL |coef| (QREFELT $ 100))))
                         . #4#)
                   (EXIT
                    (CONS 0
                          (SPADCALL (SPADCALL |cc| (QREFELT $ 101))
                                    (SPADCALL
                                     (SPADCALL
                                      (SPADCALL |plusMinus|
                                                (SPADCALL |ups|
                                                          (QREFELT $ 102))
                                                (QREFELT $ 103))
                                      (SPADCALL (|spadConstant| $ 50)
                                                (SPADCALL |ups| |ups|
                                                          (QREFELT $ 51))
                                                (QREFELT $ 48))
                                      (QREFELT $ 104))
                                     (QREFELT $ 105))
                                    (QREFELT $ 48))))))
                 #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 $ 46))
            . #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| (SPADCALL "sin" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 106) |arg| "sin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "cos" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 107) |arg| "cos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "tan" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 108) |arg| "tan" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "cot" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 109) |arg| "cot" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "sec" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 110) |arg| "sec" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "csc" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 111) |arg| "csc" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "asin" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 112) |arg| "asin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "acos" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 113) |arg| "acos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "atan" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;atancotToUPS| |arg| |posCheck?| |atanFlag| 1 $))
   ((SPADCALL |ker| (SPADCALL "acot" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;atancotToUPS| |arg| |posCheck?| |atanFlag| -1 $))
   ((SPADCALL |ker| (SPADCALL "asec" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 114) |arg| "asec" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "acsc" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 115) |arg| "acsc" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "sinh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 116) |arg| "sinh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "cosh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 117) |arg| "cosh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "tanh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 118) |arg| "tanh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "coth" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 119) |arg| "coth" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "sech" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 120) |arg| "sech" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "csch" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 121) |arg| "csch" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "asinh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 122) |arg| "asinh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "acosh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 123) |arg| "acosh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "atanh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 124) |arg| "atanh" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "acoth" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 125) |arg| "acoth" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "asech" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 126) |arg| "asech" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "acsch" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyIfCan| (ELT $ 127) |arg| "acsch" |posCheck?| |atanFlag| $))
   ('T
    (|FS2UPS;stateProblem|
     (SPADCALL (SPADCALL |ker| (QREFELT $ 83)) (QREFELT $ 84)) "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 $ 81)) |posCheck?|
                               |atanFlag| (QREFELT $ 46))
                     . #1#)
               (EXIT
                (COND ((QEQCAR |expon| 1) |expon|)
                      (#2#
                       (SEQ
                        (LETT |ans|
                              (SPADCALL
                               (SPADCALL (CDR |expon|) (CDR |logBase|)
                                         (QREFELT $ 51))
                               (QREFELT $ 80))
                              . #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 $ 129)) $)
            (|FS2UPS;smpElem| (SPADCALL |f| (QREFELT $ 130)) $) (QREFELT $ 89))) 

(DEFUN |FS2UPS;smpElem| (|p| $)
  (SPADCALL (CONS (|function| |FS2UPS;k2Elem|) $) (ELT $ 131) |p|
            (QREFELT $ 136))) 

(DEFUN |FS2UPS;k2Elem| (|k| $)
  (PROG (|cosz| |sinz| |iez| |ez| |z| |args| #1=#:G1004 |a| #2=#:G1003)
    (RETURN
     (SEQ
      (LETT |args|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;k2Elem|))
             (SEQ (LETT |a| NIL . #3#)
                  (LETT #1# (SPADCALL |k| (QREFELT $ 73)) . #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 $ 71)))
             (#4='T
              (SEQ
               (LETT |iez|
                     (SPADCALL
                      (LETT |ez|
                            (SPADCALL (LETT |z| (|SPADfirst| |args|) . #3#)
                                      (QREFELT $ 137))
                            . #3#)
                      (QREFELT $ 138))
                     . #3#)
               (LETT |sinz| (SPADCALL |z| (QREFELT $ 139)) . #3#)
               (LETT |cosz| (SPADCALL |z| (QREFELT $ 140)) . #3#)
               (EXIT
                (COND
                 ((SPADCALL |k| (SPADCALL "tan" (QREFELT $ 77)) (QREFELT $ 78))
                  (SPADCALL |sinz| |cosz| (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "cot" (QREFELT $ 77)) (QREFELT $ 78))
                  (SPADCALL |cosz| |sinz| (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "sec" (QREFELT $ 77)) (QREFELT $ 78))
                  (SPADCALL |cosz| (QREFELT $ 138)))
                 ((SPADCALL |k| (SPADCALL "csc" (QREFELT $ 77)) (QREFELT $ 78))
                  (SPADCALL |sinz| (QREFELT $ 138)))
                 ((SPADCALL |k| (SPADCALL "sinh" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 99))
                            (SPADCALL 2 (QREFELT $ 98)) (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "cosh" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 141))
                            (SPADCALL 2 (QREFELT $ 98)) (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "tanh" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 99))
                            (SPADCALL |ez| |iez| (QREFELT $ 141))
                            (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "coth" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 141))
                            (SPADCALL |ez| |iez| (QREFELT $ 99))
                            (QREFELT $ 89)))
                 ((SPADCALL |k| (SPADCALL "sech" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 141))
                                      (QREFELT $ 138))
                            (QREFELT $ 143)))
                 ((SPADCALL |k| (SPADCALL "csch" (QREFELT $ 77))
                            (QREFELT $ 78))
                  (SPADCALL 2
                            (SPADCALL (SPADCALL |ez| |iez| (QREFELT $ 99))
                                      (QREFELT $ 138))
                            (QREFELT $ 143)))
                 (#4#
                  (SPADCALL (SPADCALL |k| (QREFELT $ 145)) |args|
                            (QREFELT $ 147))))))))))))) 

(DEFUN |FS2UPS;contOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 148) (QREFELT $ 151))) 

(DEFUN |FS2UPS;bddOnReals?| (|fcn| $)
  (SPADCALL |fcn| (QREFELT $ 149) (QREFELT $ 151))) 

(DEFUN |FS2UPS;exprToGenUPS;FEBSU;24| (|fcn| |posCheck?| |atanFlag| $)
  (|FS2UPS;iExprToGenUPS| (|FS2UPS;newElem| |fcn| $) |posCheck?| |atanFlag| $)) 

(DEFUN |FS2UPS;iExprToGenUPS| (|fcn| |posCheck?| |atanFlag| $)
  (PROG (|ker| |power| #1=#:G1022 |expt| #2=#:G1018 |prod| |sum| |poly|)
    (RETURN
     (SEQ
      (LETT |poly| (SPADCALL |fcn| (QREFELT $ 36))
            . #3=(|FS2UPS;iExprToGenUPS|))
      (EXIT
       (COND
        ((QEQCAR |poly| 0)
         (CONS 0
               (|FS2UPS;polyToUPS|
                (SPADCALL (QCDR |poly|) (QREFELT $ 11) (QREFELT $ 40)) $)))
        ((QEQCAR (LETT |sum| (SPADCALL |fcn| (QREFELT $ 42)) . #3#) 0)
         (|FS2UPS;listToUPS|
          (PROG2
              (LETT #2# |sum| . #3#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          (CONS (|function| |FS2UPS;iExprToGenUPS|) $) |posCheck?| |atanFlag|
          (|spadConstant| $ 47) (ELT $ 48) $))
        ((QEQCAR (LETT |prod| (SPADCALL |fcn| (QREFELT $ 49)) . #3#) 0)
         (|FS2UPS;listToUPS|
          (PROG2
              (LETT #2# |prod| . #3#)
              (QCDR #2#)
            (|check-union| (QEQCAR #2# 0) (|List| (QREFELT $ 7)) #2#))
          (CONS (|function| |FS2UPS;iExprToGenUPS|) $) |posCheck?| |atanFlag|
          (|spadConstant| $ 50) (ELT $ 51) $))
        ((QEQCAR (LETT |expt| (|FS2UPS;isNonTrivPower| |fcn| $) . #3#) 0)
         (SEQ
          (LETT |power|
                (PROG2
                    (LETT #1# |expt| . #3#)
                    (QCDR #1#)
                  (|check-union| (QEQCAR #1# 0)
                                 (|Record| (|:| |val| (QREFELT $ 7))
                                           (|:| |exponent| (|Integer|)))
                                 #1#))
                . #3#)
          (EXIT
           (|FS2UPS;powerToGenUPS| (QCAR |power|) (QCDR |power|) |posCheck?|
            |atanFlag| $))))
        (#4='T
         (SEQ (LETT |ker| (SPADCALL |fcn| (QREFELT $ 53)) . #3#)
              (EXIT
               (COND
                ((QEQCAR |ker| 0)
                 (|FS2UPS;kernelToGenUPS| (QCDR |ker|) |posCheck?| |atanFlag|
                  $))
                (#4#
                 (|error|
                  "exprToGenUPS: neither a sum, product, power, nor kernel")))))))))))) 

(DEFUN |FS2UPS;opsInvolvingX| (|fcn| $)
  (PROG (|opList| |op| #1=#:G1039 |k| #2=#:G1038)
    (RETURN
     (SEQ
      (LETT |opList|
            (PROGN
             (LETT #2# NIL . #3=(|FS2UPS;opsInvolvingX|))
             (SEQ (LETT |k| NIL . #3#)
                  (LETT #1# (SPADCALL |fcn| (QREFELT $ 154)) . #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 $ 145)) . #3#)
                         (QREFELT $ 155))
                        (SPADCALL (QREFELT $ 11)
                                  (SPADCALL
                                   (|SPADfirst| (SPADCALL |k| (QREFELT $ 73)))
                                   (QREFELT $ 75))
                                  (QREFELT $ 76)))
                       ('T 'NIL))
                      (LETT #2# (CONS |op| #2#) . #3#)))))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT (SPADCALL |opList| (QREFELT $ 157))))))) 

(DEFUN |FS2UPS;opInOpList?| (|name| |opList| $)
  (PROG (#1=#:G1041 #2=#:G1043 #3=#:G1044 |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 $ 158))
                   (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 $ 53)) |FS2UPS;exponential?|)
          (EXIT
           (COND
            ((QEQCAR |ker| 0)
             (SPADCALL (QCDR |ker|) (SPADCALL "exp" (QREFELT $ 77))
                       (QREFELT $ 78)))
            ('T 'NIL))))))) 

(DEFUN |FS2UPS;productOfNonZeroes?| (|fcn| $)
  (PROG (#1=#:G1055 #2=#:G1059 #3=#:G1060 |term| |prod|)
    (RETURN
     (SEQ
      (EXIT
       (COND ((|FS2UPS;exponential?| |fcn| $) 'T)
             (#4='T
              (SEQ
               (LETT |prod| (SPADCALL |fcn| (QREFELT $ 49))
                     . #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 $ 11)
                                               (SPADCALL |term| (QREFELT $ 75))
                                               (QREFELT $ 76))
                                     (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=#:G1062 |b|)
    (RETURN
     (SEQ
      (LETT |b| (SPADCALL |fcn| |posCheck?| |atanFlag| (QREFELT $ 152))
            . #2=(|FS2UPS;powerToGenUPS|))
      (EXIT
       (COND ((QEQCAR |b| 1) |b|)
             ((< 0 |n|) (CONS 0 (SPADCALL (CDR |b|) |n| (QREFELT $ 65))))
             (#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 $ 17)) . #2#)
               (SEQ (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18)) . #2#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 20) (QREFELT $ 22))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 12)
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 25))
                                        (QREFELT $ 26))
                              . #2#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18))
                              . #2#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 20)
                                     (QREFELT $ 22))
                           (|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 $ 65))))
                 (#3#
                  (SEQ
                   (COND
                    ((NULL (CDR |xOpList|))
                     (COND
                      ((SPADCALL (|SPADfirst| |xOpList|)
                                 (SPADCALL "log" (QREFELT $ 77))
                                 (QREFELT $ 158))
                       (EXIT (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 65))))))))
                   (EXIT
                    (COND
                     ((|FS2UPS;productOfNonZeroes?| |coef| $)
                      (CONS 0 (SPADCALL |ups| |n| (QREFELT $ 65))))
                     (#3#
                      (|FS2UPS;stateProblem| "inv"
                       "lowest order coefficient involves x" $)))))))))))))))) 

(DEFUN |FS2UPS;kernelToGenUPS| (|ker| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G1082 |n| |arg| |args| |sym|)
    (RETURN
     (SEQ
      (LETT |sym| (SPADCALL |ker| (QREFELT $ 68))
            . #2=(|FS2UPS;kernelToGenUPS|))
      (EXIT
       (COND
        ((QEQCAR |sym| 0)
         (COND
          ((EQUAL (QCDR |sym|) (QREFELT $ 11))
           (CONS 0
                 (SPADCALL (|spadConstant| $ 16) (|spadConstant| $ 69)
                           (QREFELT $ 59))))
          (#3='T
           (CONS 0
                 (SPADCALL (SPADCALL |ker| (QREFELT $ 71))
                           (|spadConstant| $ 64) (QREFELT $ 59))))))
        ((NULL (LETT |args| (SPADCALL |ker| (QREFELT $ 73)) . #2#))
         (CONS 0
               (SPADCALL (SPADCALL |ker| (QREFELT $ 71)) (|spadConstant| $ 64)
                         (QREFELT $ 59))))
        ((NULL (CDR |args|))
         (SEQ (LETT |arg| (|SPADfirst| |args|) . #2#)
              (EXIT
               (COND
                ((SPADCALL |ker| (SPADCALL "abs" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;nthRootToGenUPS|
                  (SPADCALL |arg| |arg| (QREFELT $ 79)) 2 |posCheck?|
                  |atanFlag| $))
                ((SPADCALL |ker| (SPADCALL "%paren" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;iExprToGenUPS| |arg| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| (SPADCALL "log" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;logToGenUPS| |arg| |posCheck?| |atanFlag| $))
                ((SPADCALL |ker| (SPADCALL "exp" (QREFELT $ 77))
                           (QREFELT $ 78))
                 (|FS2UPS;expToGenUPS| |arg| |posCheck?| |atanFlag| $))
                (#3#
                 (|FS2UPS;tranToGenUPS| |ker| |arg| |posCheck?| |atanFlag|
                  $))))))
        ((SPADCALL |ker| (SPADCALL "%power" (QREFELT $ 77)) (QREFELT $ 78))
         (|FS2UPS;powToGenUPS| |args| |posCheck?| |atanFlag| $))
        ((SPADCALL |ker| (SPADCALL "nthRoot" (QREFELT $ 77)) (QREFELT $ 78))
         (SEQ
          (LETT |n| (SPADCALL (SPADCALL |args| (QREFELT $ 81)) (QREFELT $ 82))
                . #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 $ 83)) (QREFELT $ 84))
          "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=#:G1112
         #2=#:G1114 |signum| |coef| |deg| |ups| #3=#:G1097 |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 $ 17)) . #4#)
                   (SEQ
                    (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18)) . #4#)
                    (EXIT
                     (COND
                      ((SPADCALL |coef| (|spadConstant| $ 20) (QREFELT $ 22))
                       (SEQ
                        (LETT |deg|
                              (SPADCALL |ups|
                                        (SPADCALL |deg|
                                                  (SPADCALL (QREFELT $ 12)
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 25))
                                        (QREFELT $ 26))
                              . #4#)
                        (LETT |coef| (SPADCALL |ups| |deg| (QREFELT $ 18))
                              . #4#)
                        (EXIT
                         (COND
                          ((SPADCALL |coef| (|spadConstant| $ 20)
                                     (QREFELT $ 22))
                           (|error|
                            "log of series with many leading zero coefficients")))))))))
                   (COND
                    (|posCheck?|
                     (SEQ
                      (LETT |signum| (SPADCALL |coef| (QREFELT $ 30)) . #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 $ 59)) . #4#)
                   (LETT |cen| (SPADCALL |lt| (QREFELT $ 159)) . #4#)
                   (LETT |negRat?|
                         (SEQ (LETT |rat| (|FS2UPS;ratIfCan| |coef| $) . #4#)
                              (EXIT
                               (COND
                                ((QEQCAR |rat| 0)
                                 (COND
                                  ((SPADCALL (QCDR |rat|)
                                             (|spadConstant| $ 160)
                                             (QREFELT $ 161))
                                   'T)
                                  (#5# 'NIL)))
                                (#5# 'NIL))))
                         . #4#)
                   (LETT |logTerm|
                         (SEQ
                          (LETT |mon|
                                (SPADCALL
                                 (SPADCALL (QREFELT $ 11) (QREFELT $ 162))
                                 |cen| (QREFELT $ 99))
                                . #4#)
                          (LETT |pow|
                                (SPADCALL |mon| (SPADCALL |deg| (QREFELT $ 93))
                                          (QREFELT $ 163))
                                . #4#)
                          (EXIT
                           (COND
                            (|negRat?|
                             (SPADCALL (SPADCALL |coef| |pow| (QREFELT $ 79))
                                       (QREFELT $ 164)))
                            (#5#
                             (SEQ
                              (LETT |term1|
                                    (SPADCALL (SPADCALL |deg| (QREFELT $ 93))
                                              (SPADCALL |mon| (QREFELT $ 164))
                                              (QREFELT $ 79))
                                    . #4#)
                              (EXIT
                               (SPADCALL (SPADCALL |coef| (QREFELT $ 164))
                                         |term1| (QREFELT $ 141))))))))
                         . #4#)
                   (EXIT
                    (CONS 0
                          (SPADCALL
                           (SPADCALL |logTerm| (|spadConstant| $ 64)
                                     (QREFELT $ 59))
                           (SPADCALL (SPADCALL |ups| |lt| (QREFELT $ 104))
                                     (QREFELT $ 165))
                           (QREFELT $ 48))))))
                 #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| $ 69) (QREFELT $ 26))
            . #1=(|FS2UPS;expGenUPS|))
      (EXIT
       (COND
        ((SPADCALL |deg| (|spadConstant| $ 64) (QREFELT $ 92))
         (|FS2UPS;stateProblem| "exp" "essential singularity" $))
        ((SPADCALL (|spadConstant| $ 64) |deg| (QREFELT $ 92))
         (CONS 0 (SPADCALL |ups| (QREFELT $ 166))))
        (#2='T
         (SEQ
          (LETT |lc| (SPADCALL |ups| (|spadConstant| $ 64) (QREFELT $ 18))
                . #1#)
          (LETT |xOpList| (|FS2UPS;opsInvolvingX| |lc| $) . #1#)
          (COND
           ((NULL
             (|FS2UPS;opInOpList?| (SPADCALL "log" (QREFELT $ 77)) |xOpList|
              $))
            (EXIT (CONS 0 (SPADCALL |ups| (QREFELT $ 166))))))
          (LETT |expCoef|
                (SPADCALL (SPADCALL |lc| (QREFELT $ 137)) (QREFELT $ 11)
                          (QREFELT $ 168))
                . #1#)
          (EXIT
           (COND
            ((|FS2UPS;opInOpList?| (SPADCALL "log" (QREFELT $ 77))
              (|FS2UPS;opsInvolvingX| |expCoef| $) $)
             (|FS2UPS;stateProblem| "exp" "logs in constant coefficient" $))
            (#2#
             (SEQ
              (LETT |result|
                    (SPADCALL |expCoef| |posCheck?| |atanFlag| (QREFELT $ 152))
                    . #1#)
              (EXIT
               (COND ((QEQCAR |result| 1) |result|)
                     (#2#
                      (CONS 0
                            (SPADCALL (CDR |result|)
                                      (SPADCALL
                                       (SPADCALL |ups|
                                                 (SPADCALL |lc|
                                                           (|spadConstant| $
                                                                           64)
                                                           (QREFELT $ 59))
                                                 (QREFELT $ 169))
                                       (QREFELT $ 166))
                                      (QREFELT $ 51)))))))))))))))))) 

(DEFUN |FS2UPS;atancotToGenUPS|
       (|fe| |arg| |posCheck?| |atanFlag| |plusMinus| $)
  (PROG (|cc| |n| |left?| |posNegPi2| |signum| |lc| #1=#:G1150 |rn| #2=#:G1148
         |yCoef| |y| |ord| |coef| |ups| #3=#:G1129 |trouble| |result|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |result| (SPADCALL |arg| |posCheck?| |atanFlag| (QREFELT $ 152))
              . #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| $ 64) (QREFELT $ 59))))
                  (#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| $ 64) (QREFELT $ 18))
                    . #4#)
              (SEQ
               (LETT |ord|
                     (SPADCALL |ups| (|spadConstant| $ 64) (QREFELT $ 26))
                     . #4#)
               (EXIT
                (COND
                 ((SPADCALL |ord| (|spadConstant| $ 64) (QREFELT $ 90))
                  (COND
                   ((SPADCALL (SPADCALL |coef| |coef| (QREFELT $ 79))
                              (SPADCALL (|spadConstant| $ 16) (QREFELT $ 91))
                              (QREFELT $ 22))
                    (PROGN
                     (LETT #2#
                           (SEQ
                            (LETT |y|
                                  (SPADCALL (SPADCALL |ups| (QREFELT $ 102))
                                            (SPADCALL (|spadConstant| $ 50)
                                                      (SPADCALL |ups| |ups|
                                                                (QREFELT $ 51))
                                                      (QREFELT $ 48))
                                            (QREFELT $ 104))
                                  . #4#)
                            (LETT |yCoef|
                                  (SPADCALL |y|
                                            (SPADCALL (|spadConstant| $ 69)
                                                      (QREFELT $ 170))
                                            (QREFELT $ 18))
                                  . #4#)
                            (EXIT
                             (CONS 0
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |yCoef| (QREFELT $ 164))
                                     (|spadConstant| $ 64) (QREFELT $ 59))
                                    (SPADCALL
                                     (SPADCALL |y|
                                               (SPADCALL |yCoef|
                                                         (SPADCALL
                                                          (|spadConstant| $ 69)
                                                          (QREFELT $ 170))
                                                         (QREFELT $ 59))
                                               (QREFELT $ 169))
                                     (QREFELT $ 105))
                                    (QREFELT $ 48)))))
                           . #4#)
                     (GO #2#))))))))
              (LETT |cc|
                    (COND
                     ((SPADCALL |ord| (|spadConstant| $ 64) (QREFELT $ 92))
                      (COND
                       ((EQUAL |atanFlag| "complex")
                        (PROGN
                         (LETT #1#
                               (|FS2UPS;stateProblem| "atan"
                                "essential singularity" $)
                               . #4#)
                         (GO #1#)))
                       (#5#
                        (SEQ
                         (LETT |rn|
                               (|FS2UPS;ratIfCan|
                                (SPADCALL |ord| (QREFELT $ 93)) $)
                               . #4#)
                         (EXIT
                          (COND
                           ((QEQCAR |rn| 1)
                            (PROGN
                             (LETT #1#
                                   (|FS2UPS;stateProblem| "atan"
                                    "branch problem" $)
                                   . #4#)
                             (GO #1#)))
                           (#5#
                            (SEQ
                             (COND
                              ((EQUAL |atanFlag| "real: two sides")
                               (COND
                                ((ODDP (SPADCALL (QCDR |rn|) (QREFELT $ 95)))
                                 (PROGN
                                  (LETT #1#
                                        (|FS2UPS;stateProblem| "atan"
                                         "branch problem" $)
                                        . #4#)
                                  (GO #1#))))))
                             (LETT |lc| (SPADCALL |ups| |ord| (QREFELT $ 18))
                                   . #4#)
                             (LETT |signum| (SPADCALL |lc| (QREFELT $ 30))
                                   . #4#)
                             (EXIT
                              (COND
                               ((QEQCAR |signum| 1)
                                (COND
                                 ((EQUAL |atanFlag| "just do it")
                                  (COND
                                   ((EQL |plusMinus| 1)
                                    (SPADCALL (SPADCALL (QREFELT $ 96))
                                              (SPADCALL 2 (QREFELT $ 98))
                                              (QREFELT $ 89)))
                                   (#5# (|spadConstant| $ 20))))
                                 (#5#
                                  (SEQ
                                   (LETT |posNegPi2|
                                         (SPADCALL
                                          (SPADCALL
                                           (|FS2UPS;signOfExpression| |lc| $)
                                           (SPADCALL (QREFELT $ 96))
                                           (QREFELT $ 79))
                                          (SPADCALL 2 (QREFELT $ 98))
                                          (QREFELT $ 89))
                                         . #4#)
                                   (EXIT
                                    (COND ((EQL |plusMinus| 1) |posNegPi2|)
                                          (#5#
                                           (SPADCALL
                                            (SPADCALL (SPADCALL (QREFELT $ 96))
                                                      (SPADCALL 2
                                                                (QREFELT $ 98))
                                                      (QREFELT $ 89))
                                            |posNegPi2| (QREFELT $ 99)))))))))
                               (#5#
                                (SEQ
                                 (LETT |left?|
                                       (EQUAL |atanFlag| "real: left side")
                                       . #4#)
                                 (LETT |n| (QCDR |signum|) . #4#)
                                 (COND
                                  (|left?|
                                   (COND
                                    ((EQL |n| 1)
                                     (EXIT
                                      (COND
                                       ((EQL |plusMinus| 1)
                                        (SPADCALL
                                         (SPADCALL (SPADCALL (QREFELT $ 96))
                                                   (SPADCALL 2 (QREFELT $ 98))
                                                   (QREFELT $ 89))
                                         (QREFELT $ 91)))
                                       (#5# (SPADCALL (QREFELT $ 96))))))
                                    ((NULL |left?|)
                                     (COND
                                      ((EQL |n| -1)
                                       (EXIT
                                        (COND
                                         ((EQL |plusMinus| 1)
                                          (SPADCALL
                                           (SPADCALL (SPADCALL (QREFELT $ 96))
                                                     (SPADCALL 2
                                                               (QREFELT $ 98))
                                                     (QREFELT $ 89))
                                           (QREFELT $ 91)))
                                         (#5# (SPADCALL (QREFELT $ 96))))))))))
                                  ((EQL |n| -1)
                                   (EXIT
                                    (COND
                                     ((EQL |plusMinus| 1)
                                      (SPADCALL
                                       (SPADCALL (SPADCALL (QREFELT $ 96))
                                                 (SPADCALL 2 (QREFELT $ 98))
                                                 (QREFELT $ 89))
                                       (QREFELT $ 91)))
                                     (#5# (SPADCALL (QREFELT $ 96)))))))
                                 (EXIT
                                  (COND
                                   ((EQL |plusMinus| 1)
                                    (SPADCALL (SPADCALL (QREFELT $ 96))
                                              (SPADCALL 2 (QREFELT $ 98))
                                              (QREFELT $ 89)))
                                   (#5# (|spadConstant| $ 20))))))))))))))))
                     (#5# (SPADCALL |coef| (QREFELT $ 100))))
                    . #4#)
              (EXIT
               (CONS 0
                     (SPADCALL (SPADCALL |cc| (QREFELT $ 101))
                               (SPADCALL
                                (SPADCALL (SPADCALL |ups| (QREFELT $ 102))
                                          (SPADCALL (|spadConstant| $ 50)
                                                    (SPADCALL |ups| |ups|
                                                              (QREFELT $ 51))
                                                    (QREFELT $ 48))
                                          (QREFELT $ 104))
                                (QREFELT $ 105))
                               (QREFELT $ 48))))))
            #2# (EXIT #2#)))))))
      #1# (EXIT #1#))))) 

(DEFUN |FS2UPS;genUPSApplyIfCan|
       (|fcn| |arg| |fcnName| |posCheck?| |atanFlag| $)
  (PROG (#1=#:G1155 |xOpList| |lc| |deg| |ups| #2=#:G1152 |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| $ 69) (QREFELT $ 26))
                     . #3#)
               (EXIT
                (COND
                 ((SPADCALL |deg| (|spadConstant| $ 64) (QREFELT $ 92))
                  (|FS2UPS;stateProblem| |fcnName| "essential singularity" $))
                 ((SPADCALL (|spadConstant| $ 64) |deg| (QREFELT $ 92))
                  (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| $ 64) (QREFELT $ 18))
                         . #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?| (SPADCALL "log" (QREFELT $ 77))
                       |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| $ 64) (QREFELT $ 59))))
                (#2='T |ups|)))))
        (#2#
         (SEQ (LETT |ans| (SPADCALL (CDR |ups|) |fcn|) . #1#)
              (EXIT
               (COND
                ((QEQCAR |ans| 1)
                 (CONS 0 (SPADCALL |fe| (|spadConstant| $ 64) (QREFELT $ 59))))
                (#2# (CONS 0 (QCDR |ans|))))))))))))) 

(DEFUN |FS2UPS;tranToGenUPS| (|ker| |arg| |posCheck?| |atanFlag| $)
  (COND
   ((SPADCALL |ker| (SPADCALL "sin" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 71)) (ELT $ 106) |arg|
     "sin" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "cos" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;applyBddIfCan| (SPADCALL |ker| (QREFELT $ 71)) (ELT $ 107) |arg|
     "cos" |posCheck?| |atanFlag| $))
   ((SPADCALL |ker| (SPADCALL "asin" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 112) |arg| "asin" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "acos" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 113) |arg| "acos" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "atan" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;atancotToGenUPS| (SPADCALL |ker| (QREFELT $ 71)) |arg| |posCheck?|
     |atanFlag| 1 $))
   ((SPADCALL |ker| (SPADCALL "acot" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;atancotToGenUPS| (SPADCALL |ker| (QREFELT $ 71)) |arg| |posCheck?|
     |atanFlag| -1 $))
   ((SPADCALL |ker| (SPADCALL "asec" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 114) |arg| "asec" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "acsc" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 115) |arg| "acsc" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "asinh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 122) |arg| "asinh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "acosh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 123) |arg| "acosh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "atanh" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 124) |arg| "atanh" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "acoth" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 125) |arg| "acoth" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "asech" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 126) |arg| "asech" |posCheck?| |atanFlag|
     $))
   ((SPADCALL |ker| (SPADCALL "acsch" (QREFELT $ 77)) (QREFELT $ 78))
    (|FS2UPS;genUPSApplyIfCan| (ELT $ 127) |arg| "acsch" |posCheck?| |atanFlag|
     $))
   ('T
    (|FS2UPS;stateProblem|
     (SPADCALL (SPADCALL |ker| (QREFELT $ 83)) (QREFELT $ 84)) "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 $ 81))
                      |posCheck?| |atanFlag| $)
                     . #1#)
               (EXIT
                (COND ((QEQCAR |expon| 1) |expon|)
                      (#2#
                       (|FS2UPS;expGenUPS|
                        (SPADCALL (CDR |expon|) (CDR |logBase|) (QREFELT $ 51))
                        |posCheck?| |atanFlag| $)))))))))))) 

(DEFUN |FunctionSpaceToUnivariatePowerSeries| (&REST #1=#:G1200)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1201)
       (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|)
  (PROG (|pv$| $ |dv$| 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$|
            (LIST '|FunctionSpaceToUnivariatePowerSeries| DV$1 DV$2 DV$3 DV$4
                  DV$5 DV$6)
            . #1#)
      (LETT $ (GETREFV 171) . #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) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10 |#5|)
      (QSETREFV $ 11 |#6|)
      (QSETREFV $ 12 1000)
      (COND
       ((|HasSignature| |#2|
                        (LIST '|abs|
                              (LIST (|devaluate| |#2|) (|devaluate| |#2|))))
        (QSETREFV $ 87 (CONS (|dispatchFunction| |FS2UPS;localAbs;2FE;12|) $)))
       ('T
        (QSETREFV $ 87
                  (CONS (|dispatchFunction| |FS2UPS;localAbs;2FE;13|) $))))
      (QSETREFV $ 148
                (LIST #2="sin" #3="cos" #4="atan" #5="acot" "exp" "asinh"))
      (QSETREFV $ 149 (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|)
              'ZEROCOUNT (|Union| 94 '#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| 23 '"failed") (|ElementaryFunctionSign| 6 7)
              (60 . |sign|) (65 . |zero?|) (|Union| 9 '"failed")
              (|NonNegativeInteger|) (70 . |nthRootIfCan|) (|Union| 39 '#1#)
              (76 . |retractIfCan|) (|SparseUnivariatePolynomial| $) (|Symbol|)
              (|Polynomial| 6) (81 . |univariate|) (|Union| 146 '#2="failed")
              (87 . |isPlus|) (|Record| (|:| |func| 45) (|:| |prob| 45))
              (|Union| (|:| |%series| 9) (|:| |%problem| 43)) (|String|)
              |FS2UPS;exprToUPS;FEBSU;4| (92 . |Zero|) (96 . +)
              (102 . |isTimes|) (107 . |One|) (111 . *) (|Union| 70 '#1#)
              (117 . |retractIfCan|) (|SparseUnivariatePolynomial| 39)
              (122 . |zero?|) (127 . |degree|) (132 . |leadingCoefficient|)
              (137 . |coerce|) (142 . |monomial|) (148 . |reductum|)
              (|Record| (|:| |val| $) (|:| |exponent| 23)) (|Union| 61 '#2#)
              (153 . |isPower|) (158 . |Zero|) (162 . ^) (|Union| 38 '"failed")
              (|Kernel| 7) (168 . |symbolIfCan|) (173 . |One|) (|Kernel| $)
              (177 . |coerce|) (|List| 7) (182 . |argument|) (|List| 38)
              (187 . |variables|) (192 . |member?|) (198 . |coerce|)
              (203 . |is?|) (209 . *) (215 . |expIfCan|) (220 . |second|)
              (225 . |retract|) (230 . |name|) (235 . |string|)
              (240 . |logIfCan|) (245 . |abs|) (250 . |localAbs|)
              (255 . |sqrt|) (260 . /) (266 . =) (272 . -) (277 . <)
              (283 . |coerce|) (|Fraction| 23) (288 . |numer|) (293 . |pi|)
              (297 . |pi|) (301 . |coerce|) (306 . -) (312 . |atan|)
              (317 . |coerce|) (322 . |differentiate|) (327 . *) (333 . /)
              (339 . |integrate|) (344 . |sinIfCan|) (349 . |cosIfCan|)
              (354 . |tanIfCan|) (359 . |cotIfCan|) (364 . |secIfCan|)
              (369 . |cscIfCan|) (374 . |asinIfCan|) (379 . |acosIfCan|)
              (384 . |asecIfCan|) (389 . |acscIfCan|) (394 . |sinhIfCan|)
              (399 . |coshIfCan|) (404 . |tanhIfCan|) (409 . |cothIfCan|)
              (414 . |sechIfCan|) (419 . |cschIfCan|) (424 . |asinhIfCan|)
              (429 . |acoshIfCan|) (434 . |atanhIfCan|) (439 . |acothIfCan|)
              (444 . |asechIfCan|) (449 . |acschIfCan|)
              (|SparseMultivariatePolynomial| 6 70) (454 . |numer|)
              (459 . |denom|) (464 . |coerce|) (|Mapping| 7 67) (|Mapping| 7 6)
              (|SparseMultivariatePolynomial| 6 67)
              (|PolynomialCategoryLifting| (|IndexedExponents| 67) 67 6 134 7)
              (469 . |map|) (476 . |exp|) (481 . |inv|) (486 . |sin|)
              (491 . |cos|) (496 . +) (|PositiveInteger|) (502 . *)
              (|BasicOperator|) (508 . |operator|) (|List| $) (513 . |elt|)
              'CONTFCNS 'BDDFCNS (|List| 45) (519 . |member?|)
              |FS2UPS;exprToGenUPS;FEBSU;24| (|List| 70) (525 . |tower|)
              (530 . |unary?|) (|List| 144) (535 . |removeDuplicates|)
              (540 . |is?|) (546 . |center|) (551 . |Zero|) (555 . <)
              (561 . |coerce|) (566 . ^) (572 . |log|) (577 . |log|)
              (582 . |exp|) (|ElementaryFunctionStructurePackage| 6 7)
              (587 . |normalize|) (593 . -) (599 . -))
           '#(|localAbs| 604 |exprToUPS| 609 |exprToGenUPS| 616) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 170
                                                 '(1 7 13 0 14 0 6 0 15 0 7 0
                                                   16 1 9 8 0 17 2 9 7 0 8 18 0
                                                   6 0 19 0 7 0 20 2 7 21 0 0
                                                   22 1 8 0 23 24 2 8 0 0 0 25
                                                   2 9 8 0 8 26 1 23 21 0 27 1
                                                   29 28 7 30 1 8 21 0 31 2 10
                                                   32 9 33 34 1 7 35 0 36 2 39
                                                   37 0 38 40 1 7 41 0 42 0 9 0
                                                   47 2 9 0 0 0 48 1 7 41 0 49
                                                   0 9 0 50 2 9 0 0 0 51 1 7 52
                                                   0 53 1 54 21 0 55 1 54 33 0
                                                   56 1 54 39 0 57 1 7 0 39 58
                                                   2 9 0 7 8 59 1 54 0 0 60 1 7
                                                   62 0 63 0 8 0 64 2 9 0 0 23
                                                   65 1 67 66 0 68 0 8 0 69 1 7
                                                   0 70 71 1 67 72 0 73 1 7 74
                                                   0 75 2 74 21 38 0 76 1 38 0
                                                   45 77 2 67 21 0 38 78 2 7 0
                                                   0 0 79 1 10 32 9 80 1 72 7 0
                                                   81 1 7 23 0 82 1 67 38 0 83
                                                   1 38 45 0 84 1 10 32 9 85 1
                                                   7 0 0 86 1 0 7 7 87 1 7 0 0
                                                   88 2 7 0 0 0 89 2 8 21 0 0
                                                   90 1 7 0 0 91 2 8 21 0 0 92
                                                   1 7 0 8 93 1 94 23 0 95 0 7
                                                   0 96 0 9 0 97 1 7 0 23 98 2
                                                   7 0 0 0 99 1 7 0 0 100 1 9 0
                                                   7 101 1 9 0 0 102 2 9 0 23 0
                                                   103 2 9 0 0 0 104 1 9 0 0
                                                   105 1 10 32 9 106 1 10 32 9
                                                   107 1 10 32 9 108 1 10 32 9
                                                   109 1 10 32 9 110 1 10 32 9
                                                   111 1 10 32 9 112 1 10 32 9
                                                   113 1 10 32 9 114 1 10 32 9
                                                   115 1 10 32 9 116 1 10 32 9
                                                   117 1 10 32 9 118 1 10 32 9
                                                   119 1 10 32 9 120 1 10 32 9
                                                   121 1 10 32 9 122 1 10 32 9
                                                   123 1 10 32 9 124 1 10 32 9
                                                   125 1 10 32 9 126 1 10 32 9
                                                   127 1 7 128 0 129 1 7 128 0
                                                   130 1 7 0 6 131 3 135 7 132
                                                   133 134 136 1 7 0 0 137 1 7
                                                   0 0 138 1 7 0 0 139 1 7 0 0
                                                   140 2 7 0 0 0 141 2 7 0 142
                                                   0 143 1 67 144 0 145 2 7 0
                                                   144 146 147 2 150 21 45 0
                                                   151 1 7 153 0 154 1 144 21 0
                                                   155 1 156 0 0 157 2 144 21 0
                                                   38 158 1 9 7 0 159 0 94 0
                                                   160 2 94 21 0 0 161 1 7 0 38
                                                   162 2 7 0 0 0 163 1 7 0 0
                                                   164 1 9 0 0 165 1 9 0 0 166
                                                   2 167 7 7 38 168 2 9 0 0 0
                                                   169 1 8 0 0 170 1 0 7 7 87 3
                                                   0 44 7 21 45 46 3 0 44 7 21
                                                   45 152)))))
           '|lookupComplete|)) 
