
(/VERSIONCHECK 2) 

(DEFUN |QUAT;Zero;$;1| ($)
  (VECTOR (|spadConstant| $ 9) (|spadConstant| $ 9)
          (|spadConstant| $ 9) (|spadConstant| $ 9))) 

(DEFUN |QUAT;One;$;2| ($)
  (VECTOR (|spadConstant| $ 11) (|spadConstant| $ 9)
          (|spadConstant| $ 9) (|spadConstant| $ 9))) 

(PUT '|QUAT;real;$R;3| '|SPADreplace| '(XLAM (|x|) (QVELT |x| 0))) 

(DEFUN |QUAT;real;$R;3| (|x| $) (QVELT |x| 0)) 

(PUT '|QUAT;imagI;$R;4| '|SPADreplace| '(XLAM (|x|) (QVELT |x| 1))) 

(DEFUN |QUAT;imagI;$R;4| (|x| $) (QVELT |x| 1)) 

(PUT '|QUAT;imagJ;$R;5| '|SPADreplace| '(XLAM (|x|) (QVELT |x| 2))) 

(DEFUN |QUAT;imagJ;$R;5| (|x| $) (QVELT |x| 2)) 

(PUT '|QUAT;imagK;$R;6| '|SPADreplace| '(XLAM (|x|) (QVELT |x| 3))) 

(DEFUN |QUAT;imagK;$R;6| (|x| $) (QVELT |x| 3)) 

(PUT '|QUAT;quatern;4R$;7| '|SPADreplace| 'VECTOR) 

(DEFUN |QUAT;quatern;4R$;7| (|a| |b| |c| |d| $)
  (VECTOR |a| |b| |c| |d|)) 

(DEFUN |QUAT;*;3$;8| (|x| |y| $)
  (VECTOR (SPADCALL
              (SPADCALL
                  (SPADCALL
                      (SPADCALL (QVELT |x| 0) (QVELT |y| 0)
                          (QREFELT $ 17))
                      (SPADCALL (QVELT |x| 1) (QVELT |y| 1)
                          (QREFELT $ 17))
                      (QREFELT $ 18))
                  (SPADCALL (QVELT |x| 2) (QVELT |y| 2) (QREFELT $ 17))
                  (QREFELT $ 18))
              (SPADCALL (QVELT |x| 3) (QVELT |y| 3) (QREFELT $ 17))
              (QREFELT $ 18))
          (SPADCALL
              (SPADCALL
                  (SPADCALL
                      (SPADCALL (QVELT |x| 0) (QVELT |y| 1)
                          (QREFELT $ 17))
                      (SPADCALL (QVELT |x| 1) (QVELT |y| 0)
                          (QREFELT $ 17))
                      (QREFELT $ 19))
                  (SPADCALL (QVELT |x| 2) (QVELT |y| 3) (QREFELT $ 17))
                  (QREFELT $ 19))
              (SPADCALL (QVELT |x| 3) (QVELT |y| 2) (QREFELT $ 17))
              (QREFELT $ 18))
          (SPADCALL
              (SPADCALL
                  (SPADCALL
                      (SPADCALL (QVELT |x| 0) (QVELT |y| 2)
                          (QREFELT $ 17))
                      (SPADCALL (QVELT |x| 2) (QVELT |y| 0)
                          (QREFELT $ 17))
                      (QREFELT $ 19))
                  (SPADCALL (QVELT |x| 3) (QVELT |y| 1) (QREFELT $ 17))
                  (QREFELT $ 19))
              (SPADCALL (QVELT |x| 1) (QVELT |y| 3) (QREFELT $ 17))
              (QREFELT $ 18))
          (SPADCALL
              (SPADCALL
                  (SPADCALL
                      (SPADCALL (QVELT |x| 0) (QVELT |y| 3)
                          (QREFELT $ 17))
                      (SPADCALL (QVELT |x| 3) (QVELT |y| 0)
                          (QREFELT $ 17))
                      (QREFELT $ 19))
                  (SPADCALL (QVELT |x| 1) (QVELT |y| 2) (QREFELT $ 17))
                  (QREFELT $ 19))
              (SPADCALL (QVELT |x| 2) (QVELT |y| 1) (QREFELT $ 17))
              (QREFELT $ 18)))) 

(DEFUN |Quaternion| (#0=#:G1841)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1842)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|Quaternion|)
                       '|domainEqualList|)
                   . #2=(|Quaternion|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|Quaternion;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#) (HREM |$ConstructorCache| '|Quaternion|))))))))))) 

(DEFUN |Quaternion;| (|#1|)
  (PROG (DV$1 |dv$| $ #0=#:G1840 |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #1=(|Quaternion|))
        (LETT |dv$| (LIST '|Quaternion| DV$1) . #1#)
        (LETT $ (GETREFV 47) . #1#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1|
                                '(|CharacteristicNonZero|))
                            (|HasCategory| |#1|
                                '(|CharacteristicZero|))
                            (|HasCategory| |#1|
                                '(|ConvertibleTo| (|InputForm|)))
                            (|HasCategory| |#1| '(|Field|))
                            (LETT #0#
                                  (|HasCategory| |#1| '(|EntireRing|)) . #1#)
                            (OR #0# (|HasCategory| |#1| '(|Field|)))
                            (|HasCategory| |#1| '(|OrderedSet|))
                            (|HasCategory| |#1|
                                '(|LinearlyExplicitRingOver|
                                     (|Integer|)))
                            (|HasCategory| |#1|
                                (LIST '|InnerEvalable| '(|Symbol|)
                                      (|devaluate| |#1|)))
                            (|HasCategory| |#1|
                                (LIST '|Evalable| (|devaluate| |#1|)))
                            (|HasCategory| |#1|
                                (LIST '|Eltable| (|devaluate| |#1|)
                                      (|devaluate| |#1|)))
                            (|HasCategory| |#1|
                                '(|PartialDifferentialRing| (|Symbol|)))
                            (|HasCategory| |#1| '(|DifferentialRing|))
                            (|HasCategory| |#1|
                                '(|RetractableTo|
                                     (|Fraction| (|Integer|))))
                            (|HasCategory| |#1|
                                '(|RetractableTo| (|Integer|)))
                            (|HasCategory| |#1| '(|RealNumberSystem|))
                            (|HasCategory| |#1|
                                '(|IntegerNumberSystem|))
                            (OR (|HasCategory| |#1|
                                    '(|RetractableTo|
                                      (|Fraction| (|Integer|))))
                                (|HasCategory| |#1| '(|Field|))))) . #1#))
        (|haddProp| |$ConstructorCache| '|Quaternion| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7
            (|Record| (|:| |r| |#1|) (|:| |i| |#1|) (|:| |j| |#1|)
                (|:| |k| |#1|)))
        $)))) 

(MAKEPROP '|Quaternion| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) '|Rep|
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |QUAT;Zero;$;1|) $))
             (0 . |Zero|)
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |QUAT;One;$;2|) $))
             (4 . |One|) |QUAT;real;$R;3| |QUAT;imagI;$R;4|
             |QUAT;imagJ;$R;5| |QUAT;imagK;$R;6| |QUAT;quatern;4R$;7|
             (8 . *) (14 . -) (20 . +) |QUAT;*;3$;8| (|Fraction| 28)
             (|Union| $ '"failed") (|InputForm|) (|NonNegativeInteger|)
             (|Equation| 6) (|List| 25) (|List| 6) (|Integer|)
             (|List| 30) (|Symbol|) (|Union| 21 '"failed") (|Boolean|)
             (|Matrix| 28) (|Matrix| $)
             (|Record| (|:| |mat| 33) (|:| |vec| (|Vector| 28)))
             (|Vector| $) (|List| 24) (|Union| 28 '"failed")
             (|Matrix| 6)
             (|Record| (|:| |mat| 39) (|:| |vec| (|Vector| 6)))
             (|Mapping| 6 6) (|Union| 6 '"failed") (|PositiveInteger|)
             (|SingleInteger|) (|String|) (|OutputForm|))
          '#(~= 26 |zero?| 32 |subtractIfCan| 37 |sample| 43
             |retractIfCan| 47 |retract| 62 |reducedSystem| 77 |recip|
             99 |real| 104 |rationalIfCan| 109 |rational?| 114
             |rational| 119 |quatern| 124 |one?| 132 |norm| 137 |min|
             142 |max| 148 |map| 154 |latex| 160 |inv| 165 |imagK| 170
             |imagJ| 175 |imagI| 180 |hash| 185 |eval| 190 |elt| 230
             |differentiate| 236 |convert| 286 |conjugate| 291 |coerce|
             296 |charthRoot| 316 |characteristic| 321 |abs| 325 ^ 330
             |Zero| 348 |One| 352 D 356 >= 406 > 412 = 418 <= 424 < 430
             - 436 + 447 ** 453 * 471)
          'NIL
          (CONS (|makeByteWordVec2| 15
                    '(0 4 0 0 0 4 0 0 1 2 6 4 8 12 13 0 0 5 4 0 0 0 0 5
                      4 4 0 0 0 0 0 0 0 0 0 7 0 0 10 0 0 0 0 3 5 9 10
                      11 14 15))
                (CONS '#(|QuaternionCategory&| |DivisionRing&|
                         |Algebra&| |FullyLinearlyExplicitRingOver&|
                         |DifferentialExtension&| |Algebra&| NIL
                         |Module&| NIL NIL NIL |Module&| NIL
                         |PartialDifferentialRing&| |DifferentialRing&|
                         |Ring&| NIL NIL NIL NIL NIL NIL NIL NIL NIL
                         NIL |AbelianGroup&| NIL NIL |AbelianMonoid&|
                         |Monoid&| NIL |FullyEvalableOver&|
                         |SemiGroup&| |AbelianSemiGroup&| |OrderedSet&|
                         |FullyRetractableTo&| |SetCategory&|
                         |Evalable&| |RetractableTo&| NIL |BasicType&|
                         NIL NIL NIL |InnerEvalable&| |InnerEvalable&|
                         NIL |RetractableTo&| |RetractableTo&|)
                      (CONS '#((|QuaternionCategory| 6)
                               (|DivisionRing|) (|Algebra| 6)
                               (|FullyLinearlyExplicitRingOver| 6)
                               (|DifferentialExtension| 6)
                               (|Algebra| 21)
                               (|LinearlyExplicitRingOver| 6)
                               (|Module| 6) (|CharacteristicNonZero|)
                               (|CharacteristicZero|) (|EntireRing|)
                               (|Module| 21)
                               (|LinearlyExplicitRingOver| 28)
                               (|PartialDifferentialRing| 30)
                               (|DifferentialRing|) (|Ring|)
                               (|BiModule| 6 6) (|BiModule| $$ $$)
                               (|BiModule| 21 21) (|Rng|)
                               (|RightModule| 6) (|LeftModule| 6)
                               (|LeftModule| $$) (|RightModule| $$)
                               (|LeftModule| 21) (|RightModule| 21)
                               (|AbelianGroup|)
                               (|CancellationAbelianMonoid|)
                               (|SemiRing|) (|AbelianMonoid|)
                               (|Monoid|) (|SemiRng|)
                               (|FullyEvalableOver| 6) (|SemiGroup|)
                               (|AbelianSemiGroup|) (|OrderedSet|)
                               (|FullyRetractableTo| 6) (|SetCategory|)
                               (|Evalable| 6) (|RetractableTo| 6)
                               (|unitsKnown|) (|BasicType|)
                               (|CoercibleTo| 46) (|ConvertibleTo| 23)
                               (|noZeroDivisors|)
                               (|InnerEvalable| 30 6)
                               (|InnerEvalable| 6 6) (|Eltable| 6 $$)
                               (|RetractableTo| 21)
                               (|RetractableTo| 28))
                            (|makeByteWordVec2| 46
                                '(0 6 0 9 0 6 0 11 2 6 0 0 0 17 2 6 0 0
                                  0 18 2 6 0 0 0 19 2 0 32 0 0 1 1 0 32
                                  0 1 2 0 22 0 0 1 0 0 0 1 1 14 31 0 1
                                  1 15 38 0 1 1 0 42 0 1 1 14 21 0 1 1
                                  15 28 0 1 1 0 6 0 1 1 8 33 34 1 2 8
                                  35 34 36 1 1 0 39 34 1 2 0 40 34 36 1
                                  1 0 22 0 1 1 0 6 0 12 1 17 31 0 1 1
                                  17 32 0 1 1 17 21 0 1 4 0 0 6 6 6 6
                                  16 1 0 32 0 1 1 0 6 0 1 2 7 0 0 0 1 2
                                  7 0 0 0 1 2 0 0 41 0 1 1 0 45 0 1 1 4
                                  0 0 1 1 0 6 0 15 1 0 6 0 14 1 0 6 0
                                  13 1 0 44 0 1 2 10 0 0 25 1 2 10 0 0
                                  26 1 3 10 0 0 6 6 1 3 10 0 0 27 27 1
                                  3 9 0 0 29 27 1 3 9 0 0 30 6 1 2 11 0
                                  0 6 1 2 13 0 0 24 1 1 13 0 0 1 3 12 0
                                  0 29 37 1 2 12 0 0 29 1 3 12 0 0 30
                                  24 1 2 12 0 0 30 1 2 0 0 0 41 1 3 0 0
                                  0 41 24 1 1 3 23 0 1 1 0 0 0 1 1 18 0
                                  21 1 1 0 0 6 1 1 0 0 28 1 1 0 46 0 1
                                  1 1 22 0 1 0 0 24 1 1 16 6 0 1 2 4 0
                                  0 28 1 2 0 0 0 24 1 2 0 0 0 43 1 0 0
                                  0 8 0 0 0 10 2 13 0 0 24 1 1 13 0 0 1
                                  3 12 0 0 30 24 1 3 12 0 0 29 37 1 2
                                  12 0 0 30 1 2 12 0 0 29 1 2 0 0 0 41
                                  1 3 0 0 0 41 24 1 2 7 32 0 0 1 2 7 32
                                  0 0 1 2 0 32 0 0 1 2 7 32 0 0 1 2 7
                                  32 0 0 1 2 0 0 0 0 1 1 0 0 0 1 2 0 0
                                  0 0 1 2 4 0 0 28 1 2 0 0 0 24 1 2 0 0
                                  0 43 1 2 4 0 21 0 1 2 4 0 0 21 1 2 0
                                  0 0 6 1 2 0 0 6 0 1 2 0 0 28 0 1 2 0
                                  0 0 0 20 2 0 0 24 0 1 2 0 0 43 0 1)))))
          '|lookupComplete|)) 
