
(/VERSIONCHECK 2) 

(DEFUN |RINTERP;interpolate;2L2NniF;1| (|xlist| |ylist| |m| |k| $)
  (PROG (|reslist| |i| #1=#:G692 #2=#:G691 |res| |collist| #3=#:G690 #4=#:G689
         #5=#:G688 |j| #6=#:G687 #7=#:G686 #8=#:G685 |tempvec| #9=#:G684
         #10=#:G683 #11=#:G682 #12=#:G681 #13=#:G680 #14=#:G679)
    (RETURN
     (SEQ
      (COND
       ((NULL (EQL (LENGTH |xlist|) (LENGTH |ylist|)))
        (|error| "Different number of points and values."))
       ((NULL (EQL (LENGTH |xlist|) (+ (+ |m| |k|) 1)))
        (|error| "wrong number of points"))
       ('T
        (SEQ
         (LETT |tempvec|
               (PROGN
                (LETT #14# NIL . #15=(|RINTERP;interpolate;2L2NniF;1|))
                (SEQ (LETT |i| 1 . #15#) (LETT #13# (+ (+ |m| |k|) 1) . #15#)
                     G190 (COND ((QSGREATERP |i| #13#) #16=(GO G191)))
                     (SEQ
                      (EXIT
                       (LETT #14# (CONS (|spadConstant| $ 8) #14#) . #15#)))
                     (LETT |i| (QSADD1 |i|) . #15#) #17=(GO G190) G191
                     (EXIT (NREVERSE0 #14#))))
               . #15#)
         (LETT |collist|
               (CONS |tempvec|
                     (PROGN
                      (LETT #12# NIL . #15#)
                      (SEQ (LETT |j| 1 . #15#) (LETT #11# (MAX |m| |k|) . #15#)
                           G190 (COND ((QSGREATERP |j| #11#) #16#))
                           (SEQ
                            (EXIT
                             (LETT #12#
                                   (CONS
                                    (LETT |tempvec|
                                          (PROGN
                                           (LETT #10# NIL . #15#)
                                           (SEQ (LETT |i| 1 . #15#)
                                                (LETT #9# (+ (+ |m| |k|) 1)
                                                      . #15#)
                                                G190
                                                (COND
                                                 ((QSGREATERP |i| #9#) #16#))
                                                (SEQ
                                                 (EXIT
                                                  (LETT #10#
                                                        (CONS
                                                         (SPADCALL
                                                          (SPADCALL |tempvec|
                                                                    |i|
                                                                    (QREFELT $
                                                                             11))
                                                          (SPADCALL |xlist| |i|
                                                                    (QREFELT $
                                                                             11))
                                                          (QREFELT $ 12))
                                                         #10#)
                                                        . #15#)))
                                                (LETT |i| (QSADD1 |i|) . #15#)
                                                #17# G191
                                                (EXIT (NREVERSE0 #10#))))
                                          . #15#)
                                    #12#)
                                   . #15#)))
                           (LETT |j| (QSADD1 |j|) . #15#) #17# G191
                           (EXIT (NREVERSE0 #12#)))))
               . #15#)
         (LETT |collist|
               (APPEND
                (PROGN
                 (LETT #8# NIL . #15#)
                 (SEQ (LETT |j| 1 . #15#) (LETT #7# (+ |m| 1) . #15#) G190
                      (COND ((QSGREATERP |j| #7#) #16#))
                      (SEQ
                       (EXIT
                        (LETT #8#
                              (CONS (SPADCALL |collist| |j| (QREFELT $ 16))
                                    #8#)
                              . #15#)))
                      (LETT |j| (QSADD1 |j|) . #15#) #17# G191
                      (EXIT (NREVERSE0 #8#))))
                (PROGN
                 (LETT #6# NIL . #15#)
                 (SEQ (LETT |j| 1 . #15#) (LETT #5# (+ |k| 1) . #15#) G190
                      (COND ((QSGREATERP |j| #5#) #16#))
                      (SEQ
                       (EXIT
                        (LETT #6#
                              (CONS
                               (PROGN
                                (LETT #4# NIL . #15#)
                                (SEQ (LETT |i| 1 . #15#)
                                     (LETT #3# (+ (+ |m| |k|) 1) . #15#) G190
                                     (COND ((QSGREATERP |i| #3#) #16#))
                                     (SEQ
                                      (EXIT
                                       (LETT #4#
                                             (CONS
                                              (SPADCALL
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL |collist| |j|
                                                           (QREFELT $ 16))
                                                 |i| (QREFELT $ 11))
                                                (SPADCALL |ylist| |i|
                                                          (QREFELT $ 11))
                                                (QREFELT $ 12))
                                               (QREFELT $ 17))
                                              #4#)
                                             . #15#)))
                                     (LETT |i| (QSADD1 |i|) . #15#) #17# G191
                                     (EXIT (NREVERSE0 #4#))))
                               #6#)
                              . #15#)))
                      (LETT |j| (QSADD1 |j|) . #15#) #17# G191
                      (EXIT (NREVERSE0 #6#)))))
               . #15#)
         (LETT |res|
               (SPADCALL
                (SPADCALL (SPADCALL |collist| (QREFELT $ 19)) (QREFELT $ 20))
                (QREFELT $ 22))
               . #15#)
         (COND
          ((NULL (EQL (LENGTH |res|) 1))
           (SPADCALL "Warning: unattainable points!" (QREFELT $ 26))))
         (LETT |reslist|
               (LIST
                (PROGN
                 (LETT #2# NIL . #15#)
                 (SEQ (LETT |i| 0 . #15#) G190
                      (COND ((QSGREATERP |i| |m|) #16#))
                      (SEQ
                       (EXIT
                        (LETT #2#
                              (CONS
                               (SPADCALL
                                (SPADCALL (SPADCALL |res| 1 (QREFELT $ 28))
                                          (+ |i| 1) (QREFELT $ 29))
                                (SPADCALL
                                 (SPADCALL (QREFELT $ 6) (QREFELT $ 32)) |i|
                                 (QREFELT $ 34))
                                (QREFELT $ 35))
                               #2#)
                              . #15#)))
                      (LETT |i| (QSADD1 |i|) . #15#) #17# G191
                      (EXIT (NREVERSE0 #2#))))
                (PROGN
                 (LETT #1# NIL . #15#)
                 (SEQ (LETT |i| 0 . #15#) G190
                      (COND ((QSGREATERP |i| |k|) #16#))
                      (SEQ
                       (EXIT
                        (LETT #1#
                              (CONS
                               (SPADCALL
                                (SPADCALL (SPADCALL |res| 1 (QREFELT $ 28))
                                          (+ (+ |i| |m|) 2) (QREFELT $ 29))
                                (SPADCALL
                                 (SPADCALL (QREFELT $ 6) (QREFELT $ 32)) |i|
                                 (QREFELT $ 34))
                                (QREFELT $ 35))
                               #1#)
                              . #15#)))
                      (LETT |i| (QSADD1 |i|) . #15#) #17# G191
                      (EXIT (NREVERSE0 #1#)))))
               . #15#)
         (EXIT
          (SPADCALL
           (SPADCALL (ELT $ 36) (SPADCALL |reslist| 1 (QREFELT $ 39))
                     (QREFELT $ 41))
           (SPADCALL (ELT $ 36) (SPADCALL |reslist| 2 (QREFELT $ 39))
                     (QREFELT $ 41))
           (QREFELT $ 42)))))))))) 

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

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

(MAKEPROP '|RationalInterpolation| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) (0 . |One|)
              (|Integer|) (|List| 7) (4 . |elt|) (10 . *) (|Fraction| 31)
              (16 . |One|) (|List| 10) (20 . |elt|) (26 . -) (|Matrix| 7)
              (31 . |matrix|) (36 . |transpose|) (|List| 27) (41 . |nullSpace|)
              (|Void|) (|OutputForm|) (|OutputPackage|) (46 . |output|)
              (|Vector| 7) (51 . |elt|) (57 . |elt|) (|Symbol|)
              (|Polynomial| 7) (63 . |coerce|) (|NonNegativeInteger|) (68 . ^)
              (74 . *) (80 . +) (|List| 31) (|List| 37) (86 . |elt|)
              (|Mapping| 31 31 31) (92 . |reduce|) (98 . /)
              |RINTERP;interpolate;2L2NniF;1|)
           '#(|interpolate| 104) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 43
                                                 '(0 7 0 8 2 10 7 0 9 11 2 7 0
                                                   0 0 12 0 13 0 14 2 15 10 0 9
                                                   16 1 7 0 0 17 1 18 0 15 19 1
                                                   18 0 0 20 1 18 21 0 22 1 25
                                                   23 24 26 2 21 27 0 9 28 2 27
                                                   7 0 9 29 1 31 0 30 32 2 31 0
                                                   0 33 34 2 31 0 7 0 35 2 31 0
                                                   0 0 36 2 38 37 0 9 39 2 37
                                                   31 40 0 41 2 13 0 31 31 42 4
                                                   0 13 10 10 33 33 43)))))
           '|lookupComplete|)) 
