
(/VERSIONCHECK 2) 

(DEFUN |PLOT;Fnan?| (|x| $) (SPADCALL |x| |x| (QREFELT $ 17))) 

(DEFUN |PLOT;Pnan?| (|x| $)
  (SPADCALL (CONS (|function| |PLOT;Fnan?|) $) |x| (QREFELT $ 20))) 

(DEFUN |PLOT;listBranches;$L;3| (|plot| $)
  (PROG (|curve| #0=#:G1852 |p| #1=#:G1853 |newl| |outList|)
    (RETURN
      (SEQ (LETT |outList| NIL . #2=(|PLOT;listBranches;$L;3|))
           (SEQ (LETT |curve| NIL . #2#)
                (LETT #0# (QVELT |plot| 4) . #2#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |curve| (CAR #0#) . #2#) NIL))
                   #3=(GO G191)))
                (SEQ (LETT |newl| NIL . #2#)
                     (SEQ (LETT |p| NIL . #2#)
                          (LETT #1# (QVELT |curve| 3) . #2#) G190
                          (COND
                            ((OR (ATOM #1#)
                                 (PROGN
                                   (LETT |p| (CAR #1#) . #2#)
                                   NIL))
                             #3#))
                          (SEQ (EXIT (COND
                                       ((|PLOT;Pnan?| |p| $)
                                        (COND
                                          ((NULL (NULL |newl|))
                                           (SEQ
                                            (LETT |outList|
                                             (CONS
                                              (LETT |newl|
                                               (NREVERSE |newl|) . #2#)
                                              |outList|) . #2#)
                                            (EXIT
                                             (LETT |newl| NIL . #2#))))))
                                       ('T
                                        (LETT |newl|
                                         (CONS |p| |newl|) . #2#)))))
                          (LETT #1# (CDR #1#) . #2#) #4=(GO G190) G191
                          (EXIT NIL))
                     (EXIT (COND
                             ((NULL (NULL |newl|))
                              (LETT |outList|
                                    (CONS
                                     (LETT |newl|
                                      (NREVERSE |newl|) . #2#)
                                     |outList|) . #2#)))))
                (LETT #0# (CDR #0#) . #2#) #4# G191 (EXIT NIL))
           (EXIT |outList|))))) 

(DEFUN |PLOT;checkRange| (|r| $)
  (COND
    ((< (SPADCALL |r| (QREFELT $ 24)) (SPADCALL |r| (QREFELT $ 25)))
     (|error| "ranges cannot be negative"))
    ('T |r|))) 

(DEFUN |PLOT;intersect| (|s| |t| $)
  (|PLOT;checkRange|
      (SPADCALL
          (MAX (SPADCALL |s| (QREFELT $ 25))
               (SPADCALL |t| (QREFELT $ 25)))
          (MIN (SPADCALL |s| (QREFELT $ 24))
               (SPADCALL |t| (QREFELT $ 24)))
          (QREFELT $ 26))
      $)) 

(DEFUN |PLOT;union| (|s| |t| $)
  (SPADCALL
      (MIN (SPADCALL |s| (QREFELT $ 25)) (SPADCALL |t| (QREFELT $ 25)))
      (MAX (SPADCALL |s| (QREFELT $ 24)) (SPADCALL |t| (QREFELT $ 24)))
      (QREFELT $ 26))) 

(DEFUN |PLOT;join| (|l| |i| $)
  (PROG (|rr| |r| #0=#:G1862 |u|)
    (RETURN
      (SEQ (LETT |rr| (|SPADfirst| |l|) . #1=(|PLOT;join|))
           (LETT |u|
                 (COND
                   ((EQL |i| 0) (|SPADfirst| (QVELT |rr| 1)))
                   ((EQL |i| 1)
                    (SPADCALL (QVELT |rr| 1) (QREFELT $ 28)))
                   ('T (SPADCALL (QVELT |rr| 1) (QREFELT $ 29)))) . #1#)
           (SEQ (LETT |r| NIL . #1#) (LETT #0# (CDR |l|) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |r| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((EQL |i| 0)
                              (LETT |u|
                                    (|PLOT;union| |u|
                                     (|SPADfirst| (QVELT |r| 1)) $) . #1#))
                             ((EQL |i| 1)
                              (LETT |u|
                                    (|PLOT;union| |u|
                                     (SPADCALL (QVELT |r| 1)
                                      (QREFELT $ 28))
                                     $) . #1#))
                             ('T
                              (LETT |u|
                                    (|PLOT;union| |u|
                                     (SPADCALL (QVELT |r| 1)
                                      (QREFELT $ 29))
                                     $) . #1#)))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |u|))))) 

(DEFUN |PLOT;parametricRange| (|r| $) (|SPADfirst| (QVELT |r| 2))) 

(DEFUN |PLOT;minPoints;I;9| ($) (QREFELT $ 8)) 

(DEFUN |PLOT;setMinPoints;2I;10| (|n| $)
  (SEQ (COND ((< |n| 3) (|error| "three points minimum required")))
       (COND ((< (QREFELT $ 9) |n|) (SETELT $ 9 |n|)))
       (EXIT (SETELT $ 8 |n|)))) 

(DEFUN |PLOT;maxPoints;I;11| ($) (QREFELT $ 9)) 

(DEFUN |PLOT;setMaxPoints;2I;12| (|n| $)
  (SEQ (COND ((< |n| 3) (|error| "three points minimum required")))
       (COND ((< |n| (QREFELT $ 8)) (SETELT $ 8 |n|)))
       (EXIT (SETELT $ 9 |n|)))) 

(DEFUN |PLOT;screenResolution;I;13| ($) (QREFELT $ 11)) 

(DEFUN |PLOT;setScreenResolution;2I;14| (|n| $)
  (SEQ (COND ((< |n| 2) (|error| "buy a new terminal")))
       (EXIT (SETELT $ 11 |n|)))) 

(DEFUN |PLOT;adaptive?;B;15| ($) (QREFELT $ 7)) 

(DEFUN |PLOT;setAdaptive;2B;16| (|b| $) (SETELT $ 7 |b|)) 

(PUT '|PLOT;parametric?;$B;17| '|SPADreplace|
     '(XLAM (|p|) (QVELT |p| 0))) 

(DEFUN |PLOT;parametric?;$B;17| (|p| $) (QVELT |p| 0)) 

(DEFUN |PLOT;numFunEvals;I;18| ($) (QREFELT $ 10)) 

(DEFUN |PLOT;debug;2B;19| (|b| $) (SETELT $ 15 |b|)) 

(DEFUN |PLOT;xRange;$S;20| (|plot| $)
  (SPADCALL (QVELT |plot| 2) (QREFELT $ 28))) 

(DEFUN |PLOT;yRange;$S;21| (|plot| $)
  (SPADCALL (QVELT |plot| 2) (QREFELT $ 29))) 

(DEFUN |PLOT;tRange;$S;22| (|plot| $) (|SPADfirst| (QVELT |plot| 2))) 

(DEFUN |PLOT;select| (|l| |f| |g| $)
  (PROG (|p| #0=#:G1886 |n| |m|)
    (RETURN
      (SEQ (LETT |m| (SPADCALL (|SPADfirst| |l|) |f|)
                 . #1=(|PLOT;select|))
           (COND ((|PLOT;Fnan?| |m| $) (LETT |m| 0.0 . #1#)))
           (SEQ (LETT |p| NIL . #1#) (LETT #0# (CDR |l|) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |p| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (LETT |n| |m| . #1#)
                     (LETT |m|
                           (SPADCALL |m| (SPADCALL |p| |f|) |g|) . #1#)
                     (EXIT (COND
                             ((|PLOT;Fnan?| |m| $)
                              (LETT |m| |n| . #1#)))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |m|))))) 

(DEFUN |PLOT;rangeRefine| (|curve| |nRange| $)
  (PROG (|l| |h| |f| #0=#:G1904 |s| |c| |q| |n| |d| |i| |t| |p|
             |xRange| |yRange|)
    (RETURN
      (SEQ (EXIT (SEQ (|PLOT;checkRange| |nRange| $)
                      (LETT |l| (SPADCALL |nRange| (QREFELT $ 25))
                            . #1=(|PLOT;rangeRefine|))
                      (LETT |h|
                            (SPADCALL |nRange| (QREFELT $ 24)) . #1#)
                      (LETT |t| (QVELT |curve| 2) . #1#)
                      (LETT |p| (QVELT |curve| 3) . #1#)
                      (LETT |f| (QVELT |curve| 0) . #1#)
                      (SEQ G190
                           (COND
                             ((NULL (COND
                                      ((NULL |t|) 'NIL)
                                      ('T (< (|SPADfirst| |t|) |l|))))
                              #2=(GO G191)))
                           (SEQ (LETT |t| (CDR |t|) . #1#)
                                (EXIT (LETT |p| (CDR |p|) . #1#)))
                           NIL #3=(GO G190) G191 (EXIT NIL))
                      (LETT |c| NIL . #1#) (LETT |q| NIL . #1#)
                      (SEQ G190
                           (COND
                             ((NULL (COND
                                      ((OR (NULL |t|)
                                        (< |h| (|SPADfirst| |t|)))
                                       'NIL)
                                      ('T 'T)))
                              #2#))
                           (SEQ (LETT |c|
                                      (CONS (|SPADfirst| |t|) |c|) . #1#)
                                (LETT |q|
                                      (CONS (|SPADfirst| |p|) |q|) . #1#)
                                (LETT |t| (CDR |t|) . #1#)
                                (EXIT (LETT |p| (CDR |p|) . #1#)))
                           NIL #3# G191 (EXIT NIL))
                      (COND
                        ((NULL |c|)
                         (PROGN
                           (LETT #0#
                                 (|PLOT;basicPlot| |f| |nRange| $) . #1#)
                           (GO #0#))))
                      (COND
                        ((< (|SPADfirst| |c|) |h|)
                         (SEQ (LETT |c| (CONS |h| |c|) . #1#)
                              (LETT |q|
                                    (CONS (SPADCALL |h| |f|) |q|) . #1#)
                              (EXIT (SETELT $ 10 (+ (QREFELT $ 10) 1))))))
                      (LETT |t| (LETT |c| (NREVERSE |c|) . #1#) . #1#)
                      (LETT |p| (LETT |q| (NREVERSE |q|) . #1#) . #1#)
                      (LETT |s|
                            (/ (- |h| |l|)
                               (- (FLOAT (SPADCALL (QREFELT $ 31))
                                         MOST-POSITIVE-DOUBLE-FLOAT)
                                  1.0)) . #1#)
                      (COND
                        ((NULL (= (|SPADfirst| |t|) |l|))
                         (SEQ (LETT |t|
                                    (LETT |c| (CONS |l| |c|) . #1#) . #1#)
                              (LETT |p|
                                    (LETT |q|
                                     (CONS (SPADCALL |l| |f|) |p|) . #1#) . #1#)
                              (EXIT (SETELT $ 10 (+ (QREFELT $ 10) 1))))))
                      (SEQ G190
                           (COND
                             ((NULL (COND
                                      ((NULL (CDR |t|)) 'NIL)
                                      ('T 'T)))
                              #2#))
                           (SEQ (LETT |n|
                                      (TRUNCATE
                                       (/
                                        (-
                                         (SPADCALL |t| (QREFELT $ 46))
                                         (|SPADfirst| |t|))
                                        |s|)) . #1#)
                                (LETT |d|
                                      (/
                                       (- (SPADCALL |t| (QREFELT $ 46))
                                        (|SPADfirst| |t|))
                                       (FLOAT (+ |n| 1)
                                        MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                (SEQ (LETT |i| 1 . #1#) G190
                                     (COND ((QSGREATERP |i| |n|) #2#))
                                     (SEQ
                                      (SPADCALL |t| '|rest|
                                       (CONS (+ (|SPADfirst| |t|) |d|)
                                        (CDR |t|))
                                       (QREFELT $ 48))
                                      (SPADCALL |p| '|rest|
                                       (CONS
                                        (SPADCALL
                                         (SPADCALL |t| (QREFELT $ 46))
                                         |f|)
                                        (CDR |p|))
                                       (QREFELT $ 50))
                                      (SETELT $ 10
                                       (+ (QREFELT $ 10) 1))
                                      (LETT |t| (CDR |t|) . #1#)
                                      (EXIT (LETT |p| (CDR |p|) . #1#)))
                                     (LETT |i| (QSADD1 |i|) . #1#) #3#
                                     G191 (EXIT NIL))
                                (LETT |t| (CDR |t|) . #1#)
                                (EXIT (LETT |p| (CDR |p|) . #1#)))
                           NIL #3# G191 (EXIT NIL))
                      (LETT |xRange|
                            (SPADCALL
                                (|PLOT;select| |q| (ELT $ 52)
                                    (ELT $ 53) $)
                                (|PLOT;select| |q| (ELT $ 52)
                                    (ELT $ 54) $)
                                (QREFELT $ 26)) . #1#)
                      (LETT |yRange|
                            (SPADCALL
                                (|PLOT;select| |q| (ELT $ 55)
                                    (ELT $ 53) $)
                                (|PLOT;select| |q| (ELT $ 55)
                                    (ELT $ 54) $)
                                (QREFELT $ 26)) . #1#)
                      (EXIT (VECTOR |f|
                                    (LIST |nRange| |xRange| |yRange|)
                                    |c| |q|))))
           #0# (EXIT #0#))))) 

(DEFUN |PLOT;adaptivePlot|
       (|curve| |tRange| |xRange| |yRange| |pixelfraction| $)
  (PROG (|xDiff| |yDiff| |l| |h| |tDiff| |f| |minLength| |maxLength|
                 |tLimit| |headert| |headerp| |todot| |todop| |t0| |t1|
                 |t2| |sp| |x0| |y0| |x1| |y1| |x2| |y2| |a1| |b1| |a2|
                 |b2| |s1| |s2| |dp| #0=#:G1931 |n| |st| |tm| |tj|
                 |todo1| |todo2| |t| |p|)
    (RETURN
      (SEQ (LETT |xDiff|
                 (- (SPADCALL |xRange| (QREFELT $ 24))
                    (SPADCALL |xRange| (QREFELT $ 25)))
                 . #1=(|PLOT;adaptivePlot|))
           (LETT |yDiff|
                 (- (SPADCALL |yRange| (QREFELT $ 24))
                    (SPADCALL |yRange| (QREFELT $ 25))) . #1#)
           (COND
             ((OR (= |xDiff| 0.0) (= |yDiff| 0.0)) (EXIT |curve|)))
           (LETT |l| (SPADCALL |tRange| (QREFELT $ 25)) . #1#)
           (LETT |h| (SPADCALL |tRange| (QREFELT $ 24)) . #1#)
           (LETT |tDiff| (- |h| |l|) . #1#)
           (EXIT (COND
                   ((= |tDiff| 0.0) |curve|)
                   ('T
                    (SEQ (LETT |t| (QVELT |curve| 2) . #1#)
                         (EXIT (COND
                                 ((< (LENGTH |t|) 3) |curve|)
                                 ('T
                                  (SEQ (LETT |p|
                                        (QVELT |curve| 3) . #1#)
                                       (LETT |f|
                                        (QVELT |curve| 0) . #1#)
                                       (LETT |minLength|
                                        (/
                                         (FLOAT 4
                                          MOST-POSITIVE-DOUBLE-FLOAT)
                                         (FLOAT 500
                                          MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                       (LETT |maxLength|
                                        (/ 1.0
                                         (FLOAT 6
                                          MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                       (LETT |tLimit|
                                        (/ |tDiff|
                                         (FLOAT (* |pixelfraction| 500)
                                          MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                       (SEQ G190
                                        (COND
                                          ((NULL
                                            (COND
                                              ((NULL |t|) 'NIL)
                                              ('T
                                               (< (|SPADfirst| |t|)
                                                |l|))))
                                           #2=(GO G191)))
                                        (SEQ (LETT |t| (CDR |t|) . #1#)
                                         (EXIT
                                          (LETT |p| (CDR |p|) . #1#)))
                                        NIL #3=(GO G190) G191
                                        (EXIT NIL))
                                       (EXIT
                                        (COND
                                          ((< (LENGTH |t|) 3) |curve|)
                                          ('T
                                           (SEQ
                                            (LETT |headert| |t| . #1#)
                                            (LETT |headerp| |p| . #1#)
                                            (LETT |st| |t| . #1#)
                                            (LETT |sp| |p| . #1#)
                                            (LETT |todot| NIL . #1#)
                                            (LETT |todop| NIL . #1#)
                                            (SEQ G190
                                             (COND
                                               ((NULL
                                                 (COND
                                                   ((NULL
                                                     (CDR (CDR |st|)))
                                                    'NIL)
                                                   ('T 'T)))
                                                #2#))
                                             (SEQ
                                              (LETT |todot|
                                               (SPADCALL |todot| |st|
                                                (QREFELT $ 57)) . #1#)
                                              (LETT |todop|
                                               (SPADCALL |todop| |sp|
                                                (QREFELT $ 58)) . #1#)
                                              (LETT |st|
                                               (CDR |st|) . #1#)
                                              (EXIT
                                               (LETT |sp|
                                                (CDR |sp|) . #1#)))
                                             NIL #3# G191 (EXIT NIL))
                                            (LETT |st| |headert| . #1#)
                                            (LETT |sp| |headerp| . #1#)
                                            (LETT |todo1|
                                             |todot| . #1#)
                                            (LETT |todo2|
                                             |todop| . #1#)
                                            (LETT |n| 0 . #1#)
                                            (SEQ
                                             (EXIT
                                              (SEQ G190
                                               (COND
                                                 ((NULL
                                                   (COND
                                                     ((NULL |todo1|)
                                                      'NIL)
                                                     ('T 'T)))
                                                  #2#))
                                               (SEQ
                                                (LETT |st|
                                                 (|SPADfirst| |todo1|) . #1#)
                                                (LETT |t0|
                                                 (|SPADfirst| |st|) . #1#)
                                                (LETT |t1|
                                                 (SPADCALL |st|
                                                  (QREFELT $ 46)) . #1#)
                                                (LETT |t2|
                                                 (SPADCALL |st|
                                                  (QREFELT $ 59)) . #1#)
                                                (COND
                                                  ((< |h| |t2|)
                                                   (PROGN
                                                     (LETT #0#
                                                      |$NoValue| . #1#)
                                                     (GO #0#))))
                                                (EXIT
                                                 (COND
                                                   ((< (- |t2| |t0|)
                                                     |tLimit|)
                                                    (SEQ
                                                     (LETT |todo1|
                                                      (CDR |todo1|) . #1#)
                                                     (LETT |todo2|
                                                      (CDR |todo2|) . #1#)
                                                     (EXIT
                                                      (COND
                                                        ((NULL
                                                          (NULL
                                                           |todo1|))
                                                         (SEQ
                                                          (LETT |t|
                                                           (|SPADfirst|
                                                            |todo1|) . #1#)
                                                          (EXIT
                                                           (LETT |p|
                                                            (|SPADfirst|
                                                             |todo2|) . #1#))))))))
                                                   ('T
                                                    (SEQ
                                                     (LETT |sp|
                                                      (|SPADfirst|
                                                       |todo2|) . #1#)
                                                     (LETT |x0|
                                                      (SPADCALL
                                                       (|SPADfirst|
                                                        |sp|)
                                                       (QREFELT $ 52)) . #1#)
                                                     (LETT |y0|
                                                      (SPADCALL
                                                       (|SPADfirst|
                                                        |sp|)
                                                       (QREFELT $ 55)) . #1#)
                                                     (LETT |x1|
                                                      (SPADCALL
                                                       (SPADCALL |sp|
                                                        (QREFELT $ 60))
                                                       (QREFELT $ 52)) . #1#)
                                                     (LETT |y1|
                                                      (SPADCALL
                                                       (SPADCALL |sp|
                                                        (QREFELT $ 60))
                                                       (QREFELT $ 55)) . #1#)
                                                     (LETT |x2|
                                                      (SPADCALL
                                                       (SPADCALL |sp|
                                                        (QREFELT $ 61))
                                                       (QREFELT $ 52)) . #1#)
                                                     (LETT |y2|
                                                      (SPADCALL
                                                       (SPADCALL |sp|
                                                        (QREFELT $ 61))
                                                       (QREFELT $ 55)) . #1#)
                                                     (LETT |a1|
                                                      (/ (- |x1| |x0|)
                                                       |xDiff|) . #1#)
                                                     (LETT |b1|
                                                      (/ (- |y1| |y0|)
                                                       |yDiff|) . #1#)
                                                     (LETT |a2|
                                                      (/ (- |x2| |x1|)
                                                       |xDiff|) . #1#)
                                                     (LETT |b2|
                                                      (/ (- |y2| |y1|)
                                                       |yDiff|) . #1#)
                                                     (LETT |s1|
                                                      (SPADCALL
                                                       (+
                                                        (SPADCALL |a1|
                                                         2
                                                         (QREFELT $ 63))
                                                        (SPADCALL |b1|
                                                         2
                                                         (QREFELT $ 63)))
                                                       (QREFELT $ 64)) . #1#)
                                                     (LETT |s2|
                                                      (SPADCALL
                                                       (+
                                                        (SPADCALL |a2|
                                                         2
                                                         (QREFELT $ 63))
                                                        (SPADCALL |b2|
                                                         2
                                                         (QREFELT $ 63)))
                                                       (QREFELT $ 64)) . #1#)
                                                     (LETT |dp|
                                                      (+ (* |a1| |a2|)
                                                       (* |b1| |b2|)) . #1#)
                                                     (COND
                                                       ((< |s1|
                                                         |maxLength|)
                                                        (COND
                                                          ((< |s2|
                                                            |maxLength|)
                                                           (COND
                                                             ((OR
                                                               (= |s1|
                                                                0.0)
                                                               (= |s2|
                                                                0.0))
                                                              (EXIT
                                                               (SEQ
                                                                (LETT
                                                                 |todo1|
                                                                 (CDR
                                                                  |todo1|) . #1#)
                                                                (LETT
                                                                 |todo2|
                                                                 (CDR
                                                                  |todo2|) . #1#)
                                                                (EXIT
                                                                 (COND
                                                                   ((NULL
                                                                     (NULL
                                                                      |todo1|))
                                                                    (SEQ
                                                                     (LETT
                                                                      |t|
                                                                      (|SPADfirst|
                                                                       |todo1|) . #1#)
                                                                     (EXIT
                                                                      (LETT
                                                                       |p|
                                                                       (|SPADfirst|
                                                                        |todo2|) . #1#)))))))))
                                                             ((< |s1|
                                                               |minLength|)
                                                              (COND
                                                                ((OR
                                                                  (<
                                                                   |s2|
                                                                   |minLength|)
                                                                  (<
                                                                   (QREFELT
                                                                    $
                                                                    14)
                                                                   (/
                                                                    (/
                                                                     |dp|
                                                                     |s1|)
                                                                    |s2|)))
                                                                 (EXIT
                                                                  (SEQ
                                                                   (LETT
                                                                    |todo1|
                                                                    (CDR
                                                                     |todo1|) . #1#)
                                                                   (LETT
                                                                    |todo2|
                                                                    (CDR
                                                                     |todo2|) . #1#)
                                                                   (EXIT
                                                                    (COND
                                                                      ((NULL
                                                                        (NULL
                                                                         |todo1|))
                                                                       (SEQ
                                                                        (LETT
                                                                         |t|
                                                                         (|SPADfirst|
                                                                          |todo1|) . #1#)
                                                                        (EXIT
                                                                         (LETT
                                                                          |p|
                                                                          (|SPADfirst|
                                                                           |todo2|) . #1#)))))))))))
                                                             ('T
                                                              (COND
                                                                ((<
                                                                  (QREFELT
                                                                   $
                                                                   14)
                                                                  (/
                                                                   (/
                                                                    |dp|
                                                                    |s1|)
                                                                   |s2|))
                                                                 (EXIT
                                                                  (SEQ
                                                                   (LETT
                                                                    |todo1|
                                                                    (CDR
                                                                     |todo1|) . #1#)
                                                                   (LETT
                                                                    |todo2|
                                                                    (CDR
                                                                     |todo2|) . #1#)
                                                                   (EXIT
                                                                    (COND
                                                                      ((NULL
                                                                        (NULL
                                                                         |todo1|))
                                                                       (SEQ
                                                                        (LETT
                                                                         |t|
                                                                         (|SPADfirst|
                                                                          |todo1|) . #1#)
                                                                        (EXIT
                                                                         (LETT
                                                                          |p|
                                                                          (|SPADfirst|
                                                                           |todo2|) . #1#))))))))))))))))
                                                     (COND
                                                       ((<
                                                         (QREFELT $ 9)
                                                         |n|)
                                                        (PROGN
                                                          (LETT #0#
                                                           |$NoValue| . #1#)
                                                          (GO #0#)))
                                                       ('T
                                                        (LETT |n|
                                                         (+ |n| 1) . #1#)))
                                                     (LETT |st|
                                                      (CDR |t|) . #1#)
                                                     (EXIT
                                                      (COND
                                                        ((NULL
                                                          (CDR
                                                           (CDR |st|)))
                                                         (SEQ
                                                          (LETT |tm|
                                                           (/
                                                            (+ |t0|
                                                             |t1|)
                                                            (FLOAT 2
                                                             MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                                          (LETT |tj|
                                                           |tm| . #1#)
                                                          (SPADCALL |t|
                                                           '|rest|
                                                           (CONS |tj|
                                                            (CDR |t|))
                                                           (QREFELT $
                                                            48))
                                                          (SPADCALL |p|
                                                           '|rest|
                                                           (CONS
                                                            (SPADCALL
                                                             |tj| |f|)
                                                            (CDR |p|))
                                                           (QREFELT $
                                                            50))
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |t|
                                                           (CDR |t|) . #1#)
                                                          (LETT |p|
                                                           (CDR |p|) . #1#)
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |t|
                                                           (CDR |t|) . #1#)
                                                          (LETT |p|
                                                           (CDR |p|) . #1#)
                                                          (LETT |tm|
                                                           (/
                                                            (+ |t1|
                                                             |t2|)
                                                            (FLOAT 2
                                                             MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                                          (LETT |tj|
                                                           |tm| . #1#)
                                                          (SPADCALL |t|
                                                           '|rest|
                                                           (CONS |tj|
                                                            (CDR |t|))
                                                           (QREFELT $
                                                            48))
                                                          (SPADCALL |p|
                                                           '|rest|
                                                           (CONS
                                                            (SPADCALL
                                                             |tj| |f|)
                                                            (CDR |p|))
                                                           (QREFELT $
                                                            50))
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |todo1|
                                                           (CDR
                                                            |todo1|) . #1#)
                                                          (LETT |todo2|
                                                           (CDR
                                                            |todo2|) . #1#)
                                                          (EXIT
                                                           (COND
                                                             ((NULL
                                                               (NULL
                                                                |todo1|))
                                                              (SEQ
                                                               (LETT
                                                                |t|
                                                                (|SPADfirst|
                                                                 |todo1|) . #1#)
                                                               (EXIT
                                                                (LETT
                                                                 |p|
                                                                 (|SPADfirst|
                                                                  |todo2|) . #1#))))))))
                                                        ('T
                                                         (SEQ
                                                          (LETT |tm|
                                                           (/
                                                            (+ |t0|
                                                             |t1|)
                                                            (FLOAT 2
                                                             MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                                          (LETT |tj|
                                                           |tm| . #1#)
                                                          (SPADCALL |t|
                                                           '|rest|
                                                           (CONS |tj|
                                                            (CDR |t|))
                                                           (QREFELT $
                                                            48))
                                                          (SPADCALL |p|
                                                           '|rest|
                                                           (CONS
                                                            (SPADCALL
                                                             |tj| |f|)
                                                            (CDR |p|))
                                                           (QREFELT $
                                                            50))
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |t|
                                                           (CDR |t|) . #1#)
                                                          (LETT |p|
                                                           (CDR |p|) . #1#)
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |t|
                                                           (CDR |t|) . #1#)
                                                          (LETT |p|
                                                           (CDR |p|) . #1#)
                                                          (LETT |todo1|
                                                           (CDR
                                                            |todo1|) . #1#)
                                                          (LETT |todo2|
                                                           (CDR
                                                            |todo2|) . #1#)
                                                          (LETT |tm|
                                                           (/
                                                            (+ |t1|
                                                             |t2|)
                                                            (FLOAT 2
                                                             MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
                                                          (LETT |tj|
                                                           |tm| . #1#)
                                                          (SPADCALL |t|
                                                           '|rest|
                                                           (CONS |tj|
                                                            (CDR |t|))
                                                           (QREFELT $
                                                            48))
                                                          (SPADCALL |p|
                                                           '|rest|
                                                           (CONS
                                                            (SPADCALL
                                                             |tj| |f|)
                                                            (CDR |p|))
                                                           (QREFELT $
                                                            50))
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |t|
                                                           (CDR |t|) . #1#)
                                                          (LETT |p|
                                                           (CDR |p|) . #1#)
                                                          (LETT |todo1|
                                                           (SPADCALL
                                                            |todo1| |t|
                                                            (QREFELT $
                                                             57)) . #1#)
                                                          (LETT |todo2|
                                                           (SPADCALL
                                                            |todo2| |p|
                                                            (QREFELT $
                                                             58)) . #1#)
                                                          (LETT |todo1|
                                                           (CDR
                                                            |todo1|) . #1#)
                                                          (LETT |todo2|
                                                           (CDR
                                                            |todo2|) . #1#)
                                                          (EXIT
                                                           (COND
                                                             ((NULL
                                                               (NULL
                                                                |todo1|))
                                                              (SEQ
                                                               (LETT
                                                                |t|
                                                                (|SPADfirst|
                                                                 |todo1|) . #1#)
                                                               (EXIT
                                                                (LETT
                                                                 |p|
                                                                 (|SPADfirst|
                                                                  |todo2|) . #1#)))))))))))))))
                                               NIL #3# G191 (EXIT NIL)))
                                             #0# (EXIT #0#))
                                            (EXIT
                                             (COND
                                               ((< 0 |n|)
                                                (SEQ
                                                 (SETELT $ 10
                                                  (+ (QREFELT $ 10)
                                                   |n|))
                                                 (LETT |t|
                                                  (QVELT |curve| 2) . #1#)
                                                 (LETT |p|
                                                  (QVELT |curve| 3) . #1#)
                                                 (LETT |xRange|
                                                  (SPADCALL
                                                   (|PLOT;select| |p|
                                                    (ELT $ 52)
                                                    (ELT $ 53) $)
                                                   (|PLOT;select| |p|
                                                    (ELT $ 52)
                                                    (ELT $ 54) $)
                                                   (QREFELT $ 26)) . #1#)
                                                 (LETT |yRange|
                                                  (SPADCALL
                                                   (|PLOT;select| |p|
                                                    (ELT $ 55)
                                                    (ELT $ 53) $)
                                                   (|PLOT;select| |p|
                                                    (ELT $ 55)
                                                    (ELT $ 54) $)
                                                   (QREFELT $ 26)) . #1#)
                                                 (EXIT
                                                  (VECTOR
                                                   (QVELT |curve| 0)
                                                   (LIST |tRange|
                                                    |xRange| |yRange|)
                                                   |t| |p|))))
                                               ('T |curve|))))))))))))))))))) 

(DEFUN |PLOT;basicPlot| (|f| |tRange| $)
  (PROG (|h| |s| |i| #0=#:G1943 |l| |t| |p| |xRange| |yRange|)
    (RETURN
      (SEQ (|PLOT;checkRange| |tRange| $)
           (LETT |l| (SPADCALL |tRange| (QREFELT $ 25))
                 . #1=(|PLOT;basicPlot|))
           (LETT |h| (SPADCALL |tRange| (QREFELT $ 24)) . #1#)
           (LETT |t| (SPADCALL |l| (QREFELT $ 67)) . #1#)
           (LETT |p|
                 (SPADCALL (SPADCALL |l| |f|) (QREFELT $ 68)) . #1#)
           (LETT |s|
                 (/ (- |h| |l|)
                    (FLOAT (- (SPADCALL (QREFELT $ 31)) 1)
                           MOST-POSITIVE-DOUBLE-FLOAT)) . #1#)
           (SEQ (LETT |i| 2 . #1#)
                (LETT #0# (- (SPADCALL (QREFELT $ 31)) 1) . #1#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (LETT |l| (+ |l| |s|) . #1#)
                     (LETT |t| (CONS |l| |t|) . #1#)
                     (EXIT (LETT |p|
                                 (CONS (SPADCALL |l| |f|) |p|) . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (LETT |t| (NREVERSE (CONS |h| |t|)) . #1#)
           (LETT |p| (NREVERSE (CONS (SPADCALL |h| |f|) |p|)) . #1#)
           (LETT |xRange|
                 (SPADCALL (|PLOT;select| |p| (ELT $ 52) (ELT $ 53) $)
                     (|PLOT;select| |p| (ELT $ 52) (ELT $ 54) $)
                     (QREFELT $ 26)) . #1#)
           (LETT |yRange|
                 (SPADCALL (|PLOT;select| |p| (ELT $ 55) (ELT $ 53) $)
                     (|PLOT;select| |p| (ELT $ 55) (ELT $ 54) $)
                     (QREFELT $ 26)) . #1#)
           (EXIT (VECTOR |f| (LIST |tRange| |xRange| |yRange|) |t| |p|)))))) 

(DEFUN |PLOT;zoom;$S$;27| (|p| |xRange| $)
  (VECTOR (QVELT |p| 0)
          (LIST |xRange| (SPADCALL (QVELT |p| 1) (QREFELT $ 29)))
          (QVELT |p| 2) (QVELT |p| 3) (QVELT |p| 4))) 

(DEFUN |PLOT;zoom;$2S$;28| (|p| |xRange| |yRange| $)
  (VECTOR (QVELT |p| 0) (LIST |xRange| |yRange|) (QVELT |p| 2)
          (QVELT |p| 3) (QVELT |p| 4))) 

(DEFUN |PLOT;basicRefine| (|curve| |nRange| $)
  (PROG (|tRange| |l| |h| |f| |tm| |pm| |t| |p| |xRange| |yRange|)
    (RETURN
      (SEQ (LETT |tRange| (|SPADfirst| (QVELT |curve| 1))
                 . #0=(|PLOT;basicRefine|))
           (LETT |curve|
                 (VECTOR (QVELT |curve| 0) (QVELT |curve| 1)
                         (QVELT |curve| 2) (QVELT |curve| 3)) . #0#)
           (LETT |t|
                 (QSETVELT |curve| 2
                     (SPADCALL (QVELT |curve| 2) (QREFELT $ 71))) . #0#)
           (LETT |p|
                 (QSETVELT |curve| 3
                     (SPADCALL (QVELT |curve| 3) (QREFELT $ 72))) . #0#)
           (LETT |l| (SPADCALL |nRange| (QREFELT $ 25)) . #0#)
           (LETT |h| (SPADCALL |nRange| (QREFELT $ 24)) . #0#)
           (LETT |f| (QVELT |curve| 0) . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((NULL (CDR |t|)) 'NIL)
                           ('T (< (|SPADfirst| |t|) |h|))))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((< (SPADCALL |t| (QREFELT $ 46)) |l|)
                              (SEQ (LETT |t| (CDR |t|) . #0#)
                                   (EXIT (LETT |p| (CDR |p|) . #0#))))
                             ('T
                              (SEQ (LETT |tm|
                                    (/
                                     (+ (|SPADfirst| |t|)
                                      (SPADCALL |t| (QREFELT $ 46)))
                                     (FLOAT 2
                                      MOST-POSITIVE-DOUBLE-FLOAT)) . #0#)
                                   (LETT |pm|
                                    (SPADCALL |tm| |f|) . #0#)
                                   (SETELT $ 10 (+ (QREFELT $ 10) 1))
                                   (SPADCALL |t| '|rest|
                                    (CONS |tm| (CDR |t|))
                                    (QREFELT $ 48))
                                   (LETT |t| (CDR (CDR |t|)) . #0#)
                                   (SPADCALL |p| '|rest|
                                    (CONS |pm| (CDR |p|))
                                    (QREFELT $ 50))
                                   (EXIT
                                    (LETT |p| (CDR (CDR |p|)) . #0#)))))))
                NIL (GO G190) G191 (EXIT NIL))
           (LETT |t| (QVELT |curve| 2) . #0#)
           (LETT |p| (QVELT |curve| 3) . #0#)
           (LETT |xRange|
                 (SPADCALL (|PLOT;select| |p| (ELT $ 52) (ELT $ 53) $)
                     (|PLOT;select| |p| (ELT $ 52) (ELT $ 54) $)
                     (QREFELT $ 26)) . #0#)
           (LETT |yRange|
                 (SPADCALL (|PLOT;select| |p| (ELT $ 55) (ELT $ 53) $)
                     (|PLOT;select| |p| (ELT $ 55) (ELT $ 54) $)
                     (QREFELT $ 26)) . #0#)
           (EXIT (VECTOR (QVELT |curve| 0)
                         (LIST |tRange| |xRange| |yRange|) |t| |p|)))))) 

(DEFUN |PLOT;refine;2$;30| (|p| $)
  (SPADCALL |p| (|PLOT;parametricRange| |p| $) (QREFELT $ 73))) 

(DEFUN |PLOT;refine;$S$;31| (|p| |nRange| $)
  (PROG (|tRange| #0=#:G1964 #1=#:G1965 |tlimit| #2=#:G1966 |c|
            #3=#:G1967 |curves| |xRange| |yRange|)
    (RETURN
      (SEQ (SETELT $ 10 0)
           (LETT |tRange| (|PLOT;parametricRange| |p| $)
                 . #4=(|PLOT;refine;$S$;31|))
           (LETT |nRange| (|PLOT;intersect| |tRange| |nRange| $) . #4#)
           (LETT |curves|
                 (PROGN
                   (LETT #0# NIL . #4#)
                   (SEQ (LETT |c| NIL . #4#)
                        (LETT #1# (QVELT |p| 4) . #4#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |c| (CAR #1#) . #4#) NIL))
                           #5=(GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS
                                     (|PLOT;basicRefine| |c| |nRange|
                                      $)
                                     #0#) . #4#)))
                        (LETT #1# (CDR #1#) . #4#) #6=(GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #4#)
           (LETT |xRange| (|PLOT;join| |curves| 1 $) . #4#)
           (LETT |yRange| (|PLOT;join| |curves| 2 $) . #4#)
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |tlimit|
                         (COND
                           ((SPADCALL |p| (QREFELT $ 39)) 8)
                           ('T 1)) . #4#)
                   (LETT |curves|
                         (PROGN
                           (LETT #2# NIL . #4#)
                           (SEQ (LETT |c| NIL . #4#)
                                (LETT #3# |curves| . #4#) G190
                                (COND
                                  ((OR (ATOM #3#)
                                    (PROGN
                                      (LETT |c| (CAR #3#) . #4#)
                                      NIL))
                                   #5#))
                                (SEQ (EXIT
                                      (LETT #2#
                                       (CONS
                                        (|PLOT;adaptivePlot| |c|
                                         |nRange| |xRange| |yRange|
                                         |tlimit| $)
                                        #2#) . #4#)))
                                (LETT #3# (CDR #3#) . #4#) #6# G191
                                (EXIT (NREVERSE0 #2#)))) . #4#)
                   (LETT |xRange| (|PLOT;join| |curves| 1 $) . #4#)
                   (EXIT (LETT |yRange|
                               (|PLOT;join| |curves| 2 $) . #4#)))))
           (EXIT (VECTOR (QVELT |p| 0) (QVELT |p| 1)
                         (LIST |tRange| |xRange| |yRange|)
                         (QVELT |p| 3) |curves|)))))) 

(DEFUN |PLOT;plot;$S$;32| (|p| |tRange| $)
  (PROG (#0=#:G1975 #1=#:G1976 |tlimit| #2=#:G1977 |c| #3=#:G1978
            |curves| |xRange| |yRange|)
    (RETURN
      (SEQ (SETELT $ 10 0)
           (LETT |curves|
                 (PROGN
                   (LETT #0# NIL . #4=(|PLOT;plot;$S$;32|))
                   (SEQ (LETT |c| NIL . #4#)
                        (LETT #1# (QVELT |p| 4) . #4#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |c| (CAR #1#) . #4#) NIL))
                           #5=(GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS
                                     (|PLOT;rangeRefine| |c| |tRange|
                                      $)
                                     #0#) . #4#)))
                        (LETT #1# (CDR #1#) . #4#) #6=(GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #4#)
           (LETT |xRange| (|PLOT;join| |curves| 1 $) . #4#)
           (LETT |yRange| (|PLOT;join| |curves| 2 $) . #4#)
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |tlimit|
                         (COND
                           ((SPADCALL |p| (QREFELT $ 39)) 8)
                           ('T 1)) . #4#)
                   (LETT |curves|
                         (PROGN
                           (LETT #2# NIL . #4#)
                           (SEQ (LETT |c| NIL . #4#)
                                (LETT #3# |curves| . #4#) G190
                                (COND
                                  ((OR (ATOM #3#)
                                    (PROGN
                                      (LETT |c| (CAR #3#) . #4#)
                                      NIL))
                                   #5#))
                                (SEQ (EXIT
                                      (LETT #2#
                                       (CONS
                                        (|PLOT;adaptivePlot| |c|
                                         |tRange| |xRange| |yRange|
                                         |tlimit| $)
                                        #2#) . #4#)))
                                (LETT #3# (CDR #3#) . #4#) #6# G191
                                (EXIT (NREVERSE0 #2#)))) . #4#)
                   (LETT |xRange| (|PLOT;join| |curves| 1 $) . #4#)
                   (EXIT (LETT |yRange|
                               (|PLOT;join| |curves| 2 $) . #4#)))))
           (EXIT (VECTOR (QVELT |p| 0) (LIST |xRange| |yRange|)
                         (LIST |tRange| |xRange| |yRange|)
                         (QVELT |p| 3) |curves|)))))) 

(DEFUN |PLOT;pt| (|xx| |yy| $)
  (PROG (|l|)
    (RETURN
      (SPADCALL (LETT |l| (LIST |xx| |yy|) |PLOT;pt|) (QREFELT $ 76))))) 

(DEFUN |PLOT;myTrap| (|ff| |f| $)
  (PROG (|s| |r|)
    (RETURN
      (SEQ (LETT |s| (|trapNumericErrors| (SPADCALL |f| |ff|))
                 . #0=(|PLOT;myTrap|))
           (EXIT (COND
                   ((QEQCAR |s| 1) 0.0)
                   (#1='T
                    (SEQ (LETT |r| (QCDR |s|) . #0#)
                         (EXIT (COND
                                 ((< MOST-POSITIVE-DOUBLE-FLOAT |r|)
                                  MOST-POSITIVE-DOUBLE-FLOAT)
                                 ((< |r| MOST-NEGATIVE-DOUBLE-FLOAT)
                                  MOST-NEGATIVE-DOUBLE-FLOAT)
                                 (#1# |r|))))))))))) 

(DEFUN |PLOT;plot;MS$;35| (|f| |xRange| $)
  (PROG (|p| |r|)
    (RETURN
      (SEQ (LETT |p|
                 (|PLOT;basicPlot|
                     (CONS #'|PLOT;plot;MS$;35!0| (VECTOR $ |f|))
                     |xRange| $)
                 . #0=(|PLOT;plot;MS$;35|))
           (LETT |r| (QVELT |p| 1) . #0#)
           (SETELT $ 10 (SPADCALL (QREFELT $ 31)))
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |p|
                         (|PLOT;adaptivePlot| |p| (|SPADfirst| |r|)
                             (SPADCALL |r| (QREFELT $ 28))
                             (SPADCALL |r| (QREFELT $ 29)) 1 $) . #0#)
                   (EXIT (LETT |r| (QVELT |p| 1) . #0#)))))
           (EXIT (VECTOR 'NIL (CDR |r|) |r| NIL (LIST |p|))))))) 

(DEFUN |PLOT;plot;MS$;35!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PLOT;plot;MS$;35|)
    (RETURN
      (PROGN (|PLOT;pt| |#1| (|PLOT;myTrap| (QREFELT $$ 1) |#1| $) $))))) 

(DEFUN |PLOT;plot;M2S$;36| (|f| |xRange| |yRange| $)
  (PROG (|p|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |f| |xRange| (QREFELT $ 78))
                 |PLOT;plot;M2S$;36|)
           (QSETVELT |p| 1
               (LIST |xRange| (|PLOT;checkRange| |yRange| $)))
           (EXIT |p|))))) 

(DEFUN |PLOT;plot;2MS$;37| (|f| |g| |tRange| $)
  (PROG (|p| |r|)
    (RETURN
      (SEQ (LETT |p|
                 (|PLOT;basicPlot|
                     (CONS #'|PLOT;plot;2MS$;37!0| (VECTOR |g| $ |f|))
                     |tRange| $)
                 . #0=(|PLOT;plot;2MS$;37|))
           (LETT |r| (QVELT |p| 1) . #0#)
           (SETELT $ 10 (SPADCALL (QREFELT $ 31)))
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |p|
                         (|PLOT;adaptivePlot| |p| (|SPADfirst| |r|)
                             (SPADCALL |r| (QREFELT $ 28))
                             (SPADCALL |r| (QREFELT $ 29)) 8 $) . #0#)
                   (EXIT (LETT |r| (QVELT |p| 1) . #0#)))))
           (EXIT (VECTOR 'T (CDR |r|) |r| NIL (LIST |p|))))))) 

(DEFUN |PLOT;plot;2MS$;37!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 1) |PLOT;plot;2MS$;37|)
    (RETURN
      (PROGN
        (|PLOT;pt| (|PLOT;myTrap| (QREFELT $$ 2) |#1| $)
            (|PLOT;myTrap| (QREFELT $$ 0) |#1| $) $))))) 

(DEFUN |PLOT;plot;2M3S$;38| (|f| |g| |tRange| |xRange| |yRange| $)
  (PROG (|p|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |f| |g| |tRange| (QREFELT $ 80))
                 |PLOT;plot;2M3S$;38|)
           (QSETVELT |p| 1
               (LIST (|PLOT;checkRange| |xRange| $)
                     (|PLOT;checkRange| |yRange| $)))
           (EXIT |p|))))) 

(DEFUN |PLOT;pointPlot;MS$;39| (|f| |tRange| $)
  (PROG (|p| |r|)
    (RETURN
      (SEQ (LETT |p| (|PLOT;basicPlot| |f| |tRange| $)
                 . #0=(|PLOT;pointPlot;MS$;39|))
           (LETT |r| (QVELT |p| 1) . #0#)
           (SETELT $ 10 (SPADCALL (QREFELT $ 31)))
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |p|
                         (|PLOT;adaptivePlot| |p| (|SPADfirst| |r|)
                             (SPADCALL |r| (QREFELT $ 28))
                             (SPADCALL |r| (QREFELT $ 29)) 8 $) . #0#)
                   (EXIT (LETT |r| (QVELT |p| 1) . #0#)))))
           (EXIT (VECTOR 'T (CDR |r|) |r| NIL (LIST |p|))))))) 

(DEFUN |PLOT;pointPlot;M3S$;40| (|f| |tRange| |xRange| |yRange| $)
  (PROG (|p|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |f| |tRange| (QREFELT $ 83))
                 |PLOT;pointPlot;M3S$;40|)
           (QSETVELT |p| 1
               (LIST (|PLOT;checkRange| |xRange| $)
                     (|PLOT;checkRange| |yRange| $)))
           (EXIT |p|))))) 

(DEFUN |PLOT;plot;LS$;41| (|l| |xRange| $)
  (PROG (#0=#:G2015 #1=#:G2016 #2=#:G2017 |p| #3=#:G2019 |f| #4=#:G2018
            |t| |yRange|)
    (RETURN
      (SEQ (COND ((NULL |l|) (|error| "empty list of functions")))
           (LETT |t|
                 (PROGN
                   (LETT #0# NIL . #5=(|PLOT;plot;LS$;41|))
                   (SEQ (LETT |f| NIL . #5#) (LETT #1# |l| . #5#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |f| (CAR #1#) . #5#) NIL))
                           #6=(GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS
                                     (|PLOT;basicPlot|
                                      (CONS #'|PLOT;plot;LS$;41!0|
                                       (VECTOR $ |f|))
                                      |xRange| $)
                                     #0#) . #5#)))
                        (LETT #1# (CDR #1#) . #5#) #7=(GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #5#)
           (LETT |yRange| (|PLOT;join| |t| 2 $) . #5#)
           (SETELT $ 10 (* (LENGTH |l|) (SPADCALL (QREFELT $ 31))))
           (COND
             ((SPADCALL (QREFELT $ 37))
              (SEQ (LETT |t|
                         (PROGN
                           (LETT #2# NIL . #5#)
                           (SEQ (LETT |p| NIL . #5#)
                                (LETT #3# |t| . #5#)
                                (LETT |f| NIL . #5#)
                                (LETT #4# |l| . #5#) G190
                                (COND
                                  ((OR (ATOM #4#)
                                    (PROGN
                                      (LETT |f| (CAR #4#) . #5#)
                                      NIL)
                                    (ATOM #3#)
                                    (PROGN
                                      (LETT |p| (CAR #3#) . #5#)
                                      NIL))
                                   #6#))
                                (SEQ (EXIT
                                      (LETT #2#
                                       (CONS
                                        (|PLOT;adaptivePlot| |p|
                                         |xRange| |xRange| |yRange| 1
                                         $)
                                        #2#) . #5#)))
                                (LETT #4#
                                      (PROG1 (CDR #4#)
                                        (LETT #3# (CDR #3#) . #5#)) . #5#)
                                #7# G191 (EXIT (NREVERSE0 #2#)))) . #5#)
                   (EXIT (LETT |yRange| (|PLOT;join| |t| 2 $) . #5#)))))
           (EXIT (VECTOR 'NIL (LIST |xRange| |yRange|)
                         (LIST |xRange| |xRange| |yRange|) NIL |t|)))))) 

(DEFUN |PLOT;plot;LS$;41!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PLOT;plot;LS$;41|)
    (RETURN
      (PROGN (|PLOT;pt| |#1| (|PLOT;myTrap| (QREFELT $$ 1) |#1| $) $))))) 

(DEFUN |PLOT;plot;L2S$;42| (|l| |xRange| |yRange| $)
  (PROG (|p|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |l| |xRange| (QREFELT $ 86))
                 |PLOT;plot;L2S$;42|)
           (QSETVELT |p| 1
               (LIST |xRange| (|PLOT;checkRange| |yRange| $)))
           (EXIT |p|))))) 

(DEFUN |PLOT;plotPolar;MS$;43| (|f| |thetaRange| $)
  (PROG ()
    (RETURN
      (SPADCALL (CONS #'|PLOT;plotPolar;MS$;43!0| (VECTOR $ |f|))
          (CONS #'|PLOT;plotPolar;MS$;43!1| (VECTOR $ |f|))
          |thetaRange| (QREFELT $ 80))))) 

(DEFUN |PLOT;plotPolar;MS$;43!1| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PLOT;plotPolar;MS$;43|)
    (RETURN
      (PROGN
        (SPADCALL (SPADCALL |#1| (QREFELT $$ 1))
            (SPADCALL |#1| (QREFELT $ 90)) (QREFELT $ 89)))))) 

(DEFUN |PLOT;plotPolar;MS$;43!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PLOT;plotPolar;MS$;43|)
    (RETURN
      (PROGN
        (SPADCALL (SPADCALL |#1| (QREFELT $$ 1))
            (SPADCALL |#1| (QREFELT $ 88)) (QREFELT $ 89)))))) 

(DEFUN |PLOT;plotPolar;M$;44| (|f| $)
  (SPADCALL |f|
      (SPADCALL 0.0
          (SPADCALL 2 (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT)
              (QREFELT $ 92))
          (QREFELT $ 93))
      (QREFELT $ 91))) 

(DEFUN |PLOT;coerce;$Of;45| (|r| $)
  (PROG (|spaces| |xSymbol| |ySymbol| |tSymbol| |plotSymbol| |tRange|
            |curve| #0=#:G2032 |xRange| |yRange| |h| #1=#:G2033 |p|
            #2=#:G2034 |l| |f|)
    (RETURN
      (SEQ (LETT |spaces| (SPADCALL "   " (QREFELT $ 96))
                 . #3=(|PLOT;coerce;$Of;45|))
           (LETT |xSymbol| "x = " . #3#) (LETT |ySymbol| "y = " . #3#)
           (LETT |tSymbol| "t = " . #3#)
           (LETT |plotSymbol| "PLOT" . #3#)
           (LETT |tRange|
                 (SPADCALL (|PLOT;parametricRange| |r| $)
                     (QREFELT $ 97)) . #3#)
           (LETT |f| NIL . #3#)
           (SEQ (LETT |curve| NIL . #3#) (LETT #0# (QVELT |r| 4) . #3#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |curve| (CAR #0#) . #3#) NIL))
                   #4=(GO G191)))
                (SEQ (LETT |xRange|
                           (SPADCALL
                               (SPADCALL (QVELT |curve| 1)
                                   (QREFELT $ 28))
                               (QREFELT $ 97)) . #3#)
                     (LETT |yRange|
                           (SPADCALL
                               (SPADCALL (QVELT |curve| 1)
                                   (QREFELT $ 29))
                               (QREFELT $ 97)) . #3#)
                     (LETT |l|
                           (LIST |xSymbol| |xRange| |spaces| |ySymbol|
                                 |yRange|) . #3#)
                     (COND
                       ((SPADCALL |r| (QREFELT $ 39))
                        (LETT |l|
                              (SPADCALL
                                  (LIST |tSymbol| |tRange| |spaces|)
                                  |l| (QREFELT $ 99)) . #3#)))
                     (LETT |h| (SPADCALL |l| (QREFELT $ 101)) . #3#)
                     (LETT |l|
                           (PROGN
                             (LETT #1# NIL . #3#)
                             (SEQ (LETT |p| NIL . #3#)
                                  (LETT #2# (QVELT |curve| 3) . #3#)
                                  G190
                                  (COND
                                    ((OR (ATOM #2#)
                                      (PROGN
                                        (LETT |p| (CAR #2#) . #3#)
                                        NIL))
                                     #4#))
                                  (SEQ (EXIT
                                        (LETT #1#
                                         (CONS
                                          (SPADCALL |p|
                                           (QREFELT $ 102))
                                          #1#) . #3#)))
                                  (LETT #2# (CDR #2#) . #3#)
                                  #5=(GO G190) G191
                                  (EXIT (NREVERSE0 #1#)))) . #3#)
                     (EXIT (LETT |f|
                                 (CONS (SPADCALL (CONS |h| |l|)
                                        (QREFELT $ 103))
                                       |f|) . #3#)))
                (LETT #0# (CDR #0#) . #3#) #5# G191 (EXIT NIL))
           (EXIT (SPADCALL "PLOT" (NREVERSE |f|) (QREFELT $ 104))))))) 

(DEFUN |Plot| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G2036)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|Plot|)
                   . #1=(|Plot|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache| '|Plot|
                                   (LIST (CONS NIL (CONS 1 (|Plot;|))))))
                 (LETT #0# T . #1#))
               (COND ((NOT #0#) (HREM |$ConstructorCache| '|Plot|))))))))))) 

(DEFUN |Plot;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|Plot|) . #0=(|Plot|))
        (LETT $ (GETREFV 106) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|Plot| NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6
            (|Record| (|:| |parametric| (|Boolean|))
                (|:| |display| (|List| (|Segment| (|DoubleFloat|))))
                (|:| |bounds| (|List| (|Segment| (|DoubleFloat|))))
                (|:| |axisLabels| (|List| (|String|)))
                (|:| |functions|
                     (|List| (|Record|
                                 (|:| |source|
                                      (|Mapping|
                                       (|Point| (|DoubleFloat|))
                                       (|DoubleFloat|)))
                                 (|:| |ranges|
                                      (|List|
                                       (|Segment| (|DoubleFloat|))))
                                 (|:| |knots| (|List| (|DoubleFloat|)))
                                 (|:| |points|
                                      (|List|
                                       (|Point| (|DoubleFloat|)))))))))
        (QSETREFV $ 7 'T)
        (QSETREFV $ 8 49)
        (QSETREFV $ 9 1000)
        (QSETREFV $ 10 0)
        (QSETREFV $ 11 500)
        (QSETREFV $ 14
            (COS (SPADCALL (FLOAT 4 MOST-POSITIVE-DOUBLE-FLOAT)
                     (QREFELT $ 13))))
        (QSETREFV $ 15 'NIL)
        $)))) 

(MAKEPROP '|Plot| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL '|Rep| 'ADAPTIVE 'MINPOINTS
             'MAXPOINTS 'NUMFUNEVALS 'SCREENRES (|DoubleFloat|)
             (0 . |inv|) 'ANGLEBOUND 'DEBUG (|Boolean|) (5 . ~=)
             (|Mapping| 16 12) (|Point| 12) (11 . |any?|) (|List| 49)
             |PLOT;listBranches;$L;3| (|Segment| 12) (17 . |hi|)
             (22 . |lo|) (27 . SEGMENT) (|List| 23) (33 . |second|)
             (38 . |third|) (|Integer|) |PLOT;minPoints;I;9|
             |PLOT;setMinPoints;2I;10| |PLOT;maxPoints;I;11|
             |PLOT;setMaxPoints;2I;12| |PLOT;screenResolution;I;13|
             |PLOT;setScreenResolution;2I;14| |PLOT;adaptive?;B;15|
             |PLOT;setAdaptive;2B;16| |PLOT;parametric?;$B;17|
             |PLOT;numFunEvals;I;18| |PLOT;debug;2B;19|
             |PLOT;xRange;$S;20| |PLOT;yRange;$S;21|
             |PLOT;tRange;$S;22| (|List| 12) (43 . |second|) '"rest"
             (48 . |setelt|) (|List| 19) (55 . |setelt|)
             (|PointPackage| 12) (62 . |xCoord|) (67 . |min|)
             (73 . |max|) (79 . |yCoord|) (|List| 45) (84 . |concat!|)
             (90 . |concat!|) (96 . |third|) (101 . |second|)
             (106 . |third|) (|PositiveInteger|) (111 . **)
             (117 . |sqrt|) (|Fraction| 30) (122 . |Zero|)
             (126 . |list|) (131 . |list|) |PLOT;zoom;$S$;27|
             |PLOT;zoom;$2S$;28| (136 . |copy|) (141 . |copy|)
             |PLOT;refine;$S$;31| |PLOT;refine;2$;30|
             |PLOT;plot;$S$;32| (146 . |point|) (|Mapping| 12 12)
             |PLOT;plot;MS$;35| |PLOT;plot;M2S$;36| |PLOT;plot;2MS$;37|
             |PLOT;plot;2M3S$;38| (|Mapping| 19 12)
             |PLOT;pointPlot;MS$;39| |PLOT;pointPlot;M3S$;40|
             (|List| 77) |PLOT;plot;LS$;41| |PLOT;plot;L2S$;42|
             (151 . |cos|) (156 . *) (162 . |sin|)
             |PLOT;plotPolar;MS$;43| (167 . *) (173 . |segment|)
             |PLOT;plotPolar;M$;44| (|OutputForm|) (179 . |coerce|)
             (184 . |coerce|) (|List| 95) (189 . |concat!|) (|List| $)
             (195 . |hconcat|) (200 . |coerce|) (205 . |vconcat|)
             (210 . |prefix|) |PLOT;coerce;$Of;45|)
          '#(|zoom| 216 |yRange| 229 |xRange| 234 |tRange| 239
             |setScreenResolution| 244 |setMinPoints| 249
             |setMaxPoints| 254 |setAdaptive| 259 |screenResolution|
             264 |refine| 268 |pointPlot| 279 |plotPolar| 293 |plot|
             304 |parametric?| 352 |numFunEvals| 357 |minPoints| 361
             |maxPoints| 365 |listBranches| 369 |debug| 374 |coerce|
             379 |adaptive?| 384)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0))
                (CONS '#(NIL NIL)
                      (CONS '#((|PlottablePlaneCurveCategory|)
                               (|CoercibleTo| 95))
                            (|makeByteWordVec2| 105
                                '(1 12 0 0 13 2 12 16 0 0 17 2 19 16 18
                                  0 20 1 23 12 0 24 1 23 12 0 25 2 23 0
                                  12 12 26 1 27 23 0 28 1 27 23 0 29 1
                                  45 12 0 46 3 45 0 0 47 0 48 3 49 0 0
                                  47 0 50 1 51 12 19 52 2 12 0 0 0 53 2
                                  12 0 0 0 54 1 51 12 19 55 2 56 0 0 45
                                  57 2 21 0 0 49 58 1 45 12 0 59 1 49
                                  19 0 60 1 49 19 0 61 2 12 0 0 62 63 1
                                  12 0 0 64 0 65 0 66 1 45 0 12 67 1 49
                                  0 19 68 1 45 0 0 71 1 49 0 0 72 1 19
                                  0 45 76 1 12 0 0 88 2 12 0 0 0 89 1
                                  12 0 0 90 2 12 0 62 0 92 2 23 0 12 12
                                  93 1 95 95 0 96 1 23 95 0 97 2 98 0 0
                                  0 99 1 95 0 100 101 1 19 95 0 102 1
                                  95 0 100 103 2 95 0 0 100 104 2 0 0 0
                                  23 69 3 0 0 0 23 23 70 1 0 23 0 43 1
                                  0 23 0 42 1 0 23 0 44 1 0 30 30 36 1
                                  0 30 30 32 1 0 30 30 34 1 0 16 16 38
                                  0 0 30 35 2 0 0 0 23 73 1 0 0 0 74 2
                                  0 0 82 23 83 4 0 0 82 23 23 23 84 2 0
                                  0 77 23 91 1 0 0 77 94 2 0 0 0 23 75
                                  3 0 0 77 77 23 80 5 0 0 77 77 23 23
                                  23 81 2 0 0 85 23 86 3 0 0 85 23 23
                                  87 2 0 0 77 23 78 3 0 0 77 23 23 79 1
                                  0 16 0 39 0 0 30 40 0 0 30 31 0 0 30
                                  33 1 0 21 0 22 1 0 16 16 41 1 0 95 0
                                  105 0 0 16 37)))))
          '|lookupComplete|)) 

(MAKEPROP '|Plot| 'NILADIC T) 
