
(/VERSIONCHECK 2) 

(DEFUN |TSEREXPT;streamtaylor| (|f| |x| |xn| |d| |n| $)
  (PROG ()
    (RETURN
     (SEQ
      (SPADCALL
       (CONS #'|TSEREXPT;streamtaylor!0| (VECTOR |x| |d| |xn| |f| |n| $))
       (QREFELT $ 23)))))) 

(DEFUN |TSEREXPT;streamtaylor!0| ($$)
  (PROG ($ |n| |f| |xn| |d| |x|)
    (LETT $ (QREFELT $$ 5) . #1=(|TSEREXPT;streamtaylor|))
    (LETT |n| (QREFELT $$ 4) . #1#)
    (LETT |f| (QREFELT $$ 3) . #1#)
    (LETT |xn| (QREFELT $$ 2) . #1#)
    (LETT |d| (QREFELT $$ 1) . #1#)
    (LETT |x| (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (PROG (|qn| |ninv| |fn|)
        (RETURN
         (SEQ
          (LETT |qn| (SPADCALL (|spadConstant| $ 11) |n| (QREFELT $ 13)) NIL)
          (LETT |ninv| (SPADCALL |qn| (|spadConstant| $ 8) (QREFELT $ 14)) NIL)
          (LETT |fn| (SPADCALL |f| |xn| (QREFELT $ 17)) NIL)
          (EXIT
           (SPADCALL |fn|
                     (|TSEREXPT;streamtaylor|
                      (SPADCALL (SPADCALL |ninv| |f| (QREFELT $ 18)) |d|) |x|
                      (SPADCALL |x| |xn| (QREFELT $ 17)) |d|
                      (SPADCALL |n| (|spadConstant| $ 11) (QREFELT $ 19)) $)
                     (QREFELT $ 21)))))))))) 

(DEFUN |TSEREXPT;taylorviaderiv;UTSLLUTS;2| (|f| |lx| |ld| $)
  (PROG (|ds| |one| |xs| |fs| |x1|)
    (RETURN
     (SEQ
      (COND
       ((NULL (EQL (LENGTH |lx|) (LENGTH |ld|)))
        (|error|
         "taylorviaderiv: number of variables must equal number of derivatives"))
       ('T
        (COND ((EQL (LENGTH |lx|) 0) |f|)
              (#1='T
               (SEQ
                (LETT |x1| (|SPADfirst| |lx|)
                      . #2=(|TSEREXPT;taylorviaderiv;UTSLLUTS;2|))
                (EXIT
                 (COND
                  ((< (SPADCALL |x1| 1 (QREFELT $ 25)) 1)
                   (|error| "taylorviaderiv: variable has constant term"))
                  (#1#
                   (SEQ
                    (LETT |f|
                          (SPADCALL |f| (CDR |lx|) (CDR |ld|) (QREFELT $ 29))
                          . #2#)
                    (LETT |fs| (SPADCALL |f| (QREFELT $ 30)) . #2#)
                    (LETT |xs| (SPADCALL |x1| (QREFELT $ 30)) . #2#)
                    (EXIT
                     (COND ((SPADCALL |xs| (QREFELT $ 32)) |f|)
                           (#1#
                            (SEQ
                             (LETT |xs| (SPADCALL |xs| (QREFELT $ 33)) . #2#)
                             (LETT |one|
                                   (SPADCALL (|spadConstant| $ 9)
                                             (QREFELT $ 30))
                                   . #2#)
                             (LETT |ds|
                                   (|TSEREXPT;streamtaylor| |fs| |xs| |one|
                                    (CONS
                                     #'|TSEREXPT;taylorviaderiv;UTSLLUTS;2!0|
                                     (VECTOR $ |ld|))
                                    1 $)
                                   . #2#)
                             (EXIT
                              (SPADCALL (SPADCALL |ds| (QREFELT $ 36))
                                        (QREFELT $ 37)))))))))))))))))))) 

(DEFUN |TSEREXPT;taylorviaderiv;UTSLLUTS;2!0| (|s| $$)
  (PROG (|ld| $)
    (LETT |ld| (QREFELT $$ 1) . #1=(|TSEREXPT;taylorviaderiv;UTSLLUTS;2|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN (SPADCALL (SPADCALL |ld| (QREFELT $ 34)) |s| (QREFELT $ 35)))))) 

(DEFUN |TSEREXPT;taylorvialode;LUTSLUTS;3| (|la| |z| |lc| $)
  (PROG ()
    (RETURN
     (SEQ
      (COND
       ((< (SPADCALL |z| 1 (QREFELT $ 25)) 1)
        (|error| "taylorvialode: variable has constant term"))
       ((NULL (EQL (LENGTH |lc|) (LENGTH |la|)))
        (|error|
         "taylorvialode: number of coefficient and initial values must be equal"))
       ('T
        (SPADCALL
         (SPADCALL
          (CONS #'|TSEREXPT;taylorvialode;LUTSLUTS;3!0| (VECTOR |la| $)) |lc|
          (QREFELT $ 45))
         |z| (QREFELT $ 46)))))))) 

(DEFUN |TSEREXPT;taylorvialode;LUTSLUTS;3!0| (|ls| $$)
  (PROG ($ |la|)
    (LETT $ (QREFELT $$ 1) . #1=(|TSEREXPT;taylorvialode;LUTSLUTS;3|))
    (LETT |la| (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (PROG (#2=#:G1850 |s| #3=#:G1851 |a| #4=#:G1849)
        (RETURN
         (SEQ
          (SPADCALL (ELT $ 38)
                    (PROGN
                     (LETT #4# NIL NIL)
                     (SEQ (LETT |a| NIL NIL) (LETT #3# |la| NIL)
                          (LETT |s| NIL NIL) (LETT #2# |ls| NIL) G190
                          (COND
                           ((OR (ATOM #2#) (PROGN (LETT |s| (CAR #2#) NIL) NIL)
                                (ATOM #3#)
                                (PROGN (LETT |a| (CAR #3#) NIL) NIL))
                            (GO G191)))
                          (SEQ
                           (EXIT
                            (LETT #4#
                                  (CONS (SPADCALL |s| |a| (QREFELT $ 39)) #4#)
                                  NIL)))
                          (LETT #2# (PROG1 (CDR #2#) (LETT #3# (CDR #3#) NIL))
                                NIL)
                          (GO G190) G191 (EXIT (NREVERSE0 #4#))))
                    (QREFELT $ 41))))))))) 

(PUT '|TSEREXPT;applyTaylor;M2UTS;4| '|SPADreplace|
     '(XLAM (|g| |f|) (SPADCALL |f| |g|))) 

(DEFUN |TSEREXPT;applyTaylor;M2UTS;4| (|g| |f| $) (SPADCALL |f| |g|)) 

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

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

(MAKEPROP '|TaylorSeriesExpansionTaylor| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) (0 . |One|)
              (4 . |One|) (|Integer|) (8 . |One|) (|Fraction| 10) (12 . /)
              (18 . *) (|Stream| 6) (|StreamTaylorSeriesOperations| 6) (24 . *)
              (30 . *) (36 . +) (|Stream| 15) (42 . |concat|) (|Mapping| $)
              (48 . |delay|) (|NonNegativeInteger|) (53 . |order|) (|List| 7)
              (|Mapping| 6 6) (|List| 27) |TSEREXPT;taylorviaderiv;UTSLLUTS;2|
              (59 . |coefficients|) (|Boolean|) (64 . |empty?|) (69 . |rest|)
              (74 . |first|) (79 . |map|) (85 . |addiag|) (90 . |series|)
              (95 . +) (101 . *) (|Mapping| 7 7 7) (107 . |reduce|)
              (|Mapping| 7 26) (|List| 6)
              (|UnivariateTaylorSeriesODESolver| 6 7) (113 . |ode|)
              (119 . |elt|) |TSEREXPT;taylorvialode;LUTSLUTS;3| (|Mapping| 7 7)
              |TSEREXPT;applyTaylor;M2UTS;4|)
           '#(|taylorvialode| 125 |taylorviaderiv| 132 |applyTaylor| 146) 'NIL
           (CONS (|makeByteWordVec2| 1 '(0))
                 (CONS '#(|TaylorSeriesExpansion&|)
                       (CONS
                        '#((|TaylorSeriesExpansion| 6 24
                                                    (|SingletonAsOrderedSet|) 7
                                                    7))
                        (|makeByteWordVec2| 49
                                            '(0 6 0 8 0 7 0 9 0 10 0 11 2 12 0
                                              10 10 13 2 6 0 12 0 14 2 16 15 15
                                              15 17 2 16 15 6 15 18 2 10 0 0 0
                                              19 2 20 0 15 0 21 1 20 0 22 23 2
                                              7 24 0 24 25 1 7 15 0 30 1 15 31
                                              0 32 1 15 0 0 33 1 28 27 0 34 2
                                              15 0 27 0 35 1 16 15 20 36 1 7 0
                                              15 37 2 7 0 0 0 38 2 7 0 0 0 39 2
                                              26 7 40 0 41 2 44 7 42 43 45 2 7
                                              0 0 0 46 3 0 7 26 7 43 47 3 0 7 7
                                              26 28 29 3 0 7 6 26 28 1 2 0 7 48
                                              7 49)))))
           '|lookupComplete|)) 
