
(/VERSIONCHECK 2) 

(DEFUN |PINTERPA;LagrangeInterpolation;2LP;1| (|lx| |ly| $)
  (PROG (|ip| |xp| |pp| #1=#:G1816 |xj| |j| #2=#:G1814 |xi| #3=#:G1815 |yi|
         |i|)
    (RETURN
     (SEQ
      (COND
       ((NULL (EQL (LENGTH |lx|) (LENGTH |ly|)))
        (|error| "Different number of points and values."))
       ('T
        (SEQ
         (LETT |ip| (|spadConstant| $ 8)
               . #4=(|PINTERPA;LagrangeInterpolation;2LP;1|))
         (SEQ (LETT |i| 0 . #4#) (LETT |yi| NIL . #4#) (LETT #3# |ly| . #4#)
              (LETT |xi| NIL . #4#) (LETT #2# |lx| . #4#) G190
              (COND
               ((OR (ATOM #2#) (PROGN (LETT |xi| (CAR #2#) . #4#) NIL)
                    (ATOM #3#) (PROGN (LETT |yi| (CAR #3#) . #4#) NIL))
                #5=(GO G191)))
              (SEQ (LETT |pp| (|spadConstant| $ 9) . #4#)
                   (LETT |xp| (|spadConstant| $ 10) . #4#)
                   (SEQ (LETT |j| 0 . #4#) (LETT |xj| NIL . #4#)
                        (LETT #1# |lx| . #4#) G190
                        (COND
                         ((OR (ATOM #1#)
                              (PROGN (LETT |xj| (CAR #1#) . #4#) NIL))
                          #5#))
                        (SEQ
                         (EXIT
                          (COND
                           ((COND ((EQL |i| |j|) 'NIL) ('T 'T))
                            (SEQ
                             (LETT |pp|
                                   (SPADCALL |pp|
                                             (SPADCALL
                                              (SPADCALL (|spadConstant| $ 10) 1
                                                        (QREFELT $ 12))
                                              (SPADCALL |xj| 0 (QREFELT $ 12))
                                              (QREFELT $ 14))
                                             (QREFELT $ 15))
                                   . #4#)
                             (EXIT
                              (LETT |xp|
                                    (SPADCALL |xp|
                                              (SPADCALL |xi| |xj|
                                                        (QREFELT $ 16))
                                              (QREFELT $ 17))
                                    . #4#)))))))
                        (LETT #1#
                              (PROG1 (CDR #1#) (LETT |j| (QSADD1 |j|) . #4#))
                              . #4#)
                        #6=(GO G190) G191 (EXIT NIL))
                   (EXIT
                    (LETT |ip|
                          (SPADCALL |ip|
                                    (SPADCALL
                                     (SPADCALL |yi| |xp| (QREFELT $ 18)) |pp|
                                     (QREFELT $ 19))
                                    (QREFELT $ 20))
                          . #4#)))
              (LETT #2#
                    (PROG1 (CDR #2#)
                      (LETT #3# (PROG1 (CDR #3#) (LETT |i| (QSADD1 |i|) . #4#))
                            . #4#))
                    . #4#)
              #6# G191 (EXIT NIL))
         (EXIT |ip|)))))))) 

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

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

(MAKEPROP '|PolynomialInterpolationAlgorithms| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (0 . |Zero|) (4 . |One|) (8 . |One|) (|NonNegativeInteger|)
              (12 . |monomial|) (18 . |Zero|) (22 . -) (28 . *) (34 . -)
              (40 . *) (46 . /) (52 . *) (58 . +) (|List| 6)
              |PINTERPA;LagrangeInterpolation;2LP;1|)
           '#(|LagrangeInterpolation| 64) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 22
                                                 '(0 7 0 8 0 7 0 9 0 6 0 10 2 7
                                                   0 6 11 12 0 6 0 13 2 7 0 0 0
                                                   14 2 7 0 0 0 15 2 6 0 0 0 16
                                                   2 6 0 0 0 17 2 6 0 0 0 18 2
                                                   7 0 6 0 19 2 7 0 0 0 20 2 0
                                                   7 21 21 22)))))
           '|lookupComplete|)) 
