
(/VERSIONCHECK 2) 

(DEFUN |RINTERP;interpolate;2L2NniF;1| (|xlist| |ylist| |m| |k| $)
  (PROG (#0=#:G1833 #1=#:G1834 #2=#:G1835 #3=#:G1836 #4=#:G1837
            #5=#:G1838 |tempvec| #6=#:G1839 #7=#:G1840 #8=#:G1841 |j|
            #9=#:G1842 #10=#:G1843 #11=#:G1844 |collist| |res|
            #12=#:G1845 #13=#:G1846 |i| |reslist|)
    (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 #0# NIL
                                 . #14=(|RINTERP;interpolate;2L2NniF;1|))
                           (SEQ (LETT |i| 1 . #14#)
                                (LETT #1# (+ (+ |m| |k|) 1) . #14#)
                                G190
                                (COND
                                  ((QSGREATERP |i| #1#) #15=(GO G191)))
                                (SEQ (EXIT
                                      (LETT #0#
                                       (CONS (|spadConstant| $ 8) #0#) . #14#)))
                                (LETT |i| (QSADD1 |i|) . #14#)
                                #16=(GO G190) G191
                                (EXIT (NREVERSE0 #0#)))) . #14#)
                   (LETT |collist|
                         (CONS |tempvec|
                               (PROGN
                                 (LETT #2# NIL . #14#)
                                 (SEQ (LETT |j| 1 . #14#)
                                      (LETT #3# (MAX |m| |k|) . #14#)
                                      G190
                                      (COND
                                        ((QSGREATERP |j| #3#) #15#))
                                      (SEQ
                                       (EXIT
                                        (LETT #2#
                                         (CONS
                                          (LETT |tempvec|
                                           (PROGN
                                             (LETT #4# NIL . #14#)
                                             (SEQ (LETT |i| 1 . #14#)
                                              (LETT #5#
                                               (+ (+ |m| |k|) 1) . #14#)
                                              G190
                                              (COND
                                                ((QSGREATERP |i| #5#)
                                                 #15#))
                                              (SEQ
                                               (EXIT
                                                (LETT #4#
                                                 (CONS
                                                  (SPADCALL
                                                   (SPADCALL |tempvec|
                                                    |i| (QREFELT $ 11))
                                                   (SPADCALL |xlist|
                                                    |i| (QREFELT $ 11))
                                                   (QREFELT $ 12))
                                                  #4#) . #14#)))
                                              (LETT |i|
                                               (QSADD1 |i|) . #14#)
                                              #16# G191
                                              (EXIT (NREVERSE0 #4#)))) . #14#)
                                          #2#) . #14#)))
                                      (LETT |j| (QSADD1 |j|) . #14#)
                                      #16# G191 (EXIT (NREVERSE0 #2#))))) . #14#)
                   (LETT |collist|
                         (APPEND (PROGN
                                   (LETT #6# NIL . #14#)
                                   (SEQ (LETT |j| 1 . #14#)
                                    (LETT #7# (+ |m| 1) . #14#) G190
                                    (COND ((QSGREATERP |j| #7#) #15#))
                                    (SEQ
                                     (EXIT
                                      (LETT #6#
                                       (CONS
                                        (SPADCALL |collist| |j|
                                         (QREFELT $ 16))
                                        #6#) . #14#)))
                                    (LETT |j| (QSADD1 |j|) . #14#) #16#
                                    G191 (EXIT (NREVERSE0 #6#))))
                                 (PROGN
                                   (LETT #8# NIL . #14#)
                                   (SEQ (LETT |j| 1 . #14#)
                                    (LETT #9# (+ |k| 1) . #14#) G190
                                    (COND ((QSGREATERP |j| #9#) #15#))
                                    (SEQ
                                     (EXIT
                                      (LETT #8#
                                       (CONS
                                        (PROGN
                                          (LETT #10# NIL . #14#)
                                          (SEQ (LETT |i| 1 . #14#)
                                           (LETT #11#
                                            (+ (+ |m| |k|) 1) . #14#)
                                           G190
                                           (COND
                                             ((QSGREATERP |i| #11#)
                                              #15#))
                                           (SEQ
                                            (EXIT
                                             (LETT #10#
                                              (CONS
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL
                                                  (SPADCALL |collist|
                                                   |j| (QREFELT $ 16))
                                                  |i| (QREFELT $ 11))
                                                 (SPADCALL |ylist| |i|
                                                  (QREFELT $ 11))
                                                 (QREFELT $ 12))
                                                (QREFELT $ 17))
                                               #10#) . #14#)))
                                           (LETT |i|
                                            (QSADD1 |i|) . #14#)
                                           #16# G191
                                           (EXIT (NREVERSE0 #10#))))
                                        #8#) . #14#)))
                                    (LETT |j| (QSADD1 |j|) . #14#) #16#
                                    G191 (EXIT (NREVERSE0 #8#))))) . #14#)
                   (LETT |res|
                         (SPADCALL
                             (SPADCALL
                                 (SPADCALL |collist| (QREFELT $ 19))
                                 (QREFELT $ 20))
                             (QREFELT $ 22)) . #14#)
                   (COND
                     ((SPADCALL (LENGTH |res|) 1 (QREFELT $ 25))
                      (SPADCALL "Warning: unattainable points!"
                          (QREFELT $ 29))))
                   (LETT |reslist|
                         (LIST (PROGN
                                 (LETT #12# NIL . #14#)
                                 (SEQ (LETT |i| 0 . #14#) G190
                                      (COND
                                        ((QSGREATERP |i| |m|) #15#))
                                      (SEQ
                                       (EXIT
                                        (LETT #12#
                                         (CONS
                                          (SPADCALL
                                           (SPADCALL
                                            (SPADCALL |res| 1
                                             (QREFELT $ 31))
                                            (+ |i| 1) (QREFELT $ 32))
                                           (SPADCALL
                                            (SPADCALL (QREFELT $ 6)
                                             (QREFELT $ 35))
                                            |i| (QREFELT $ 36))
                                           (QREFELT $ 37))
                                          #12#) . #14#)))
                                      (LETT |i| (QSADD1 |i|) . #14#)
                                      #16# G191
                                      (EXIT (NREVERSE0 #12#))))
                               (PROGN
                                 (LETT #13# NIL . #14#)
                                 (SEQ (LETT |i| 0 . #14#) G190
                                      (COND
                                        ((QSGREATERP |i| |k|) #15#))
                                      (SEQ
                                       (EXIT
                                        (LETT #13#
                                         (CONS
                                          (SPADCALL
                                           (SPADCALL
                                            (SPADCALL |res| 1
                                             (QREFELT $ 31))
                                            (+ (+ |i| |m|) 2)
                                            (QREFELT $ 32))
                                           (SPADCALL
                                            (SPADCALL (QREFELT $ 6)
                                             (QREFELT $ 35))
                                            |i| (QREFELT $ 36))
                                           (QREFELT $ 37))
                                          #13#) . #14#)))
                                      (LETT |i| (QSADD1 |i|) . #14#)
                                      #16# G191
                                      (EXIT (NREVERSE0 #13#))))) . #14#)
                   (EXIT (SPADCALL
                             (SPADCALL (ELT $ 38)
                                 (SPADCALL |reslist| 1 (QREFELT $ 41))
                                 (QREFELT $ 43))
                             (SPADCALL (ELT $ 38)
                                 (SPADCALL |reslist| 2 (QREFELT $ 41))
                                 (QREFELT $ 43))
                             (QREFELT $ 44)))))))))) 

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

(DEFUN |RationalInterpolation;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|RationalInterpolation|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|RationalInterpolation| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 46) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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| 34) (16 . |One|) (|List| 10) (20 . |elt|)
             (26 . -) (|Matrix| 7) (31 . |matrix|) (36 . |transpose|)
             (|List| 30) (41 . |nullSpace|) (|Boolean|)
             (|NonNegativeInteger|) (46 . ~=) (|Void|) (|OutputForm|)
             (|OutputPackage|) (52 . |output|) (|Vector| 7)
             (57 . |elt|) (63 . |elt|) (|Symbol|) (|Polynomial| 7)
             (69 . |coerce|) (74 . **) (80 . *) (86 . +) (|List| 34)
             (|List| 39) (92 . |elt|) (|Mapping| 34 34 34)
             (98 . |reduce|) (104 . /) |RINTERP;interpolate;2L2NniF;1|)
          '#(|interpolate| 110) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 45
                                '(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 2
                                  24 23 0 0 25 1 28 26 27 29 2 21 30 0
                                  9 31 2 30 7 0 9 32 1 34 0 33 35 2 34
                                  0 0 24 36 2 34 0 7 0 37 2 34 0 0 0 38
                                  2 40 39 0 9 41 2 39 34 42 0 43 2 13 0
                                  34 34 44 4 0 13 10 10 24 24 45)))))
          '|lookupComplete|)) 
