;;; -*- Mode: Lisp; Package: Macsyma -*-
;;; Translated code for LMIVAX::MAX$DISK:[SHARE]FUNCTS.MC;56
;;; Written on 9/07/1984 00:13:05, from MACSYMA 302
;;; Translated for LPH

;;; TRANSL-AUTOLOAD version NIL
;;; TRANSS version 87 TRANSL version 1157 TRUTIL version 27
;;; TRANS1 version 108 TRANS2 version 39 TRANS3 version 50
;;; TRANS4 version 29 TRANS5 version 26 TRANSF version NIL
;;; TROPER version 15 TRPRED version 6 MTAGS version NIL
;;; MDEFUN version 58 TRANSQ version 88 FCALL version 40
;;; ACALL version 70 TRDATA version 68 MCOMPI version 146
;;; TRMODE version 73 TRHOOK version NIL
(eval-when (compile eval)
      (setq *infile-name-key*
	          (namestring (truename '#.standard-input))))

(eval-when (compile)
   (setq $tr_semicompile 'NIL)
   (setq forms-to-compile-queue ()))

(comment "MAX$DISK:[SHARE]FUNCTS.MC;56")

;;; General declarations required for translated MACSYMA code.

(DECLARE
  (SPECIAL $PIECE $INFLAG $PARTSWITCH $LISTCONSTVARS $RATFAC $TAKEGCD))

(DECLARE (SPECIAL $TAKEGCD))

(DEFMTRFUN-EXTERNAL ($CONJUGATE $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($REMPART $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($WRONSKIAN $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($ADJOINT $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($TRACEMATRIX $ANY MDEFINE NIL NIL))

(DEF-MTRVAR $RATFAC NIL 1)

(DEFMTRFUN-EXTERNAL ($RATIONAL $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($ODDP $BOOLEAN MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($EVENP $BOOLEAN MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($LOGAND $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($LOGXOR $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($LOGOR $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($UPROBE $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($KRONECKER $FIXNUM MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($NONZEROANDFREEOF $BOOLEAN MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($LCM $ANY MDEFINE T NIL))

(DEFMTRFUN-EXTERNAL ($LCM1 $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($GCDIVIDE $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($ARITHMETIC $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($GEOMETRIC $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($HARMONIC $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($ARITHSUM $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($GEOSUM $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($GAUSSPROB $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($GD $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($AGD $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($VERS $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($COVERS $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($EXSEC $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($HAV $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($COMBINATION $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($PERMUTATION $ANY MDEFINE NIL NIL))


(MEVAL* '(($MODEDECLARE) $TAKEGCD $BOOLEAN))

(MEVAL* '(($DECLARE) $TAKEGCD $SPECIAL))

(DEFPROP $TAKEGCD ASSIGN-MODE-CHECK ASSIGN)

(DEF-MTRVAR $TAKEGCD T)

(DEFPROP $CONJUGATE T TRANSLATED)

(ADD2LNC '$CONJUGATE $PROPS)

(DEFMTRFUN
  ($CONJUGATE $ANY MDEFINE NIL NIL) ($M) NIL
  (COND
    ((MFUNCTION-CALL $MATRIXP $M)
       (SIMPLIFY (FMAPL1 (GETOPR '$CONJUGATE) $M)))
    ((MFUNCTION-CALL
       $FREEOF '$%I (SIMPLIFY (MFUNCTION-CALL $SUBSTITUTE '$&I '$%I $M)))
       (SIMPLIFY (MFUNCTION-CALL $SUBSTITUTE (*MMINUS '$%I) '$%I $M)))
    (T (SIMPLIFY (MFUNCTION-CALL $RATSUBST (*MMINUS '$%I) '$%I $M)))))

(DEFPROP $REMPART T TRANSLATED)

(ADD2LNC '$REMPART $PROPS)

(DEFMTRFUN
  ($REMPART $ANY MDEFINE NIL NIL) ($EXP $N) NIL
  (SIMPLIFY
    (MFUNCTION-CALL
      APPEND
      (SIMPLIFY
	(MFUNCTION-CALL
	  $REST $EXP
	  (ADD* (COND ((MFUNCTION-CALL $LISTP $N) (MARRAYREF $N 1)) (T $N))
		-1 (- (MFUNCTION-CALL $LENGTH $EXP)))))
      ((LAMBDA ($T)
	 NIL
	 (COND
	   ((MFUNCTION-CALL
	      $ATOM
	      (SETQ
		$T (SIMPLIFY
		     (MFUNCTION-CALL
		       $REST $EXP
		       (COND ((MFUNCTION-CALL $LISTP $N) (MARRAYREF $N 2))
			     (T $N))))))
	      (SIMPLIFY (MFUNCTION-CALL LIST $T)))
	   (T (SIMPLIFY (MFUNCTION-CALL CDR $T)))))
       '$T))))

(DEFPROP $WRONSKIAN T TRANSLATED)

(ADD2LNC '$WRONSKIAN $PROPS)

(DEFMTRFUN
 ($WRONSKIAN $ANY MDEFINE NIL NIL) ($FUNCTLIST $VAR) NIL
 ((LAMBDA ($END)
   NIL
   (SETQ $END (+ (MFUNCTION-CALL $LENGTH $FUNCTLIST) -1))
   (SETQ $FUNCTLIST (LIST '(MLIST) $FUNCTLIST))
   (DO ((MDO 1 (+ 1 MDO))) ((IS-BOOLE-CHECK (MGRP MDO $END)) '$DONE)
     (SETQ
       $FUNCTLIST
       (SIMPLIFY
	 (MFUNCTION-CALL
	   $ENDCONS
	   (SIMPLIFY
	     (MAP1
	       (GETOPR
		 (M-TLAMBDA&ENV (($X) ($VAR)) NIL
				(SIMPLIFY (MFUNCTION-CALL $DIFF $X $VAR))))
	       (SIMPLIFY (MFUNCTION-CALL $LAST $FUNCTLIST))))
	   $FUNCTLIST))))
   (SIMPLIFY (MAPPLY-TR '$MATRIX $FUNCTLIST)))
  '$END))

(DEFPROP $ADJOINT T TRANSLATED)

(ADD2LNC '$ADJOINT $PROPS)

(DEFMTRFUN
 ($ADJOINT $ANY MDEFINE NIL NIL) ($M) NIL
 ((LAMBDA ($ADJOINT $LEN)
   NIL
   (SETQ
     $ADJOINT
     (SIMPLIFY (MFUNCTION-CALL
		 $DIAGMATRIX (SETQ $LEN (MFUNCTION-CALL $LENGTH $M)) 0)))
   (DO (($I 1 (+ 1 $I))) ((IS-BOOLE-CHECK (MGRP $I $LEN)) '$DONE)
     (DO (($J 1 (+ 1 $J))) ((IS-BOOLE-CHECK (MGRP $J $LEN)) '$DONE)
       (MARRAYSET
	 (MUL*
	   (POWER -1 (+ $I $J))
	   (SIMPLIFY
	     (MFUNCTION-CALL $DETERMINANT
			     (SIMPLIFY (MFUNCTION-CALL $MINOR $M $I $J)))))
	 $ADJOINT $I $J)))
   (SIMPLIFY (MFUNCTION-CALL $TRANSPOSE $ADJOINT)))
  '$ADJOINT '$LEN))

(DEFPROP $TRACEMATRIX T TRANSLATED)

(ADD2LNC '$TRACEMATRIX $PROPS)

(DEFMTRFUN
  ($TRACEMATRIX $ANY MDEFINE NIL NIL) ($M) NIL
  ((LAMBDA ($SUM $LEN)
     NIL
     (SETQ $SUM 0)
     (SETQ $LEN (MFUNCTION-CALL $LENGTH $M))
     (DO (($I 1 (+ 1 $I))) ((IS-BOOLE-CHECK (MGRP $I $LEN)) '$DONE)
       (SETQ $SUM (ADD* $SUM (SIMPLIFY (MFUNCTION-CALL $PART $M $I $I)))))
     $SUM)
   '$SUM '$LEN))

(DEFPROP $RATIONAL T TRANSLATED)

(ADD2LNC '$RATIONAL $PROPS)

(DEFMTRFUN
 ($RATIONAL $ANY MDEFINE NIL NIL) ($Z) NIL
 ((LAMBDA (|tr-gensym~1| |tr-gensym~2| |tr-gensym~3| |tr-gensym~4|)
    (UNWIND-PROTECT
      (PROGN
	(MSETCHK '$RATFAC |tr-gensym~4|)
	((LAMBDA ($N $D $CD $RATFAC)
	   NIL
	   (PROGN (MSETCHK '$RATFAC NIL) (SETQ $RATFAC NIL))
	   (SETQ
	     $N
	     (SIMPLIFY
	       (MFUNCTION-CALL
		 $RATDISREP
		 (MUL*
		   (SIMPLIFY (MFUNCTION-CALL $RATNUMER $Z))
		   (SETQ
		     $CD
		     (SIMPLIFY
		       (MFUNCTION-CALL
			 $CONJUGATE
			 (SETQ
			   $D
			   (SIMPLIFY (MFUNCTION-CALL $RATDENOM $Z))))))))))
	   (SETQ
	     $D
	     (RATF
	       (DIV $N
		    (SIMPLIFY (MFUNCTION-CALL $RATDISREP (MUL* $D $CD))))))
	   (COND ((MFUNCTION-CALL $RATP $Z) $D)
		 (T (SIMPLIFY (MFUNCTION-CALL $RATDISREP $D)))))
	 |tr-gensym~1| |tr-gensym~2| |tr-gensym~3| |tr-gensym~4|))
      (MSETCHK '$RATFAC (TRD-MSYMEVAL $RATFAC NIL))))
  '$N '$D '$CD '$RATFAC))

(DEFPROP $ODDP T TRANSLATED)

(ADD2LNC '$ODDP $PROPS)

(DEFMTRFUN ($ODDP $BOOLEAN MDEFINE NIL NIL) ($X) NIL
	   (NOT (LIKE (SIMPLIFY (MFUNCTION-CALL $LOGAND $X 1)) 0)))

(DEFPROP $EVENP T TRANSLATED)

(ADD2LNC '$EVENP $PROPS)

(DEFMTRFUN ($EVENP $BOOLEAN MDEFINE NIL NIL) ($X) NIL
	   (LIKE (SIMPLIFY (MFUNCTION-CALL $LOGAND $X 1)) 0))

(DEFPROP $LOGAND T TRANSLATED)

(ADD2LNC '$LOGAND $PROPS)

(DEFMTRFUN ($LOGAND $ANY MDEFINE NIL NIL) ($X $Y) NIL
	   (SIMPLIFY (MFUNCTION-CALL BOOLE 1 $X $Y)))

(DEFPROP $LOGXOR T TRANSLATED)

(ADD2LNC '$LOGXOR $PROPS)

(DEFMTRFUN ($LOGXOR $ANY MDEFINE NIL NIL) ($X $Y) NIL
	   (SIMPLIFY (MFUNCTION-CALL BOOLE 6 $X $Y)))

(DEFPROP $LOGOR T TRANSLATED)

(ADD2LNC '$LOGOR $PROPS)

(DEFMTRFUN ($LOGOR $ANY MDEFINE NIL NIL) ($X $Y) NIL
	   (SIMPLIFY (MFUNCTION-CALL BOOLE 7 $X $Y)))

(DEFPROP $UPROBE T TRANSLATED)

(ADD2LNC '$UPROBE $PROPS)

(DEFMTRFUN
 ($UPROBE $ANY MDEFINE NIL NIL) ($FILE) NIL
 (SIMPLIFY
   (MFUNCTION-CALL
     APPLY 'UPROBE
     (SIMPLIFY
       (MFUNCTION-CALL FULLSTRIP (SIMPLIFY (MFUNCTION-CALL CDR $FILE)))))))

(DEFPROP $KRONECKER T TRANSLATED)

(ADD2LNC '$KRONECKER $PROPS)

(DEFMTRFUN ($KRONECKER $FIXNUM MDEFINE NIL NIL)
	   ($M $N) NIL (COND ((LIKE $M $N) 1) (T 0)))

(DEFPROP $NONZEROANDFREEOF T TRANSLATED)

(ADD2LNC '$NONZEROANDFREEOF $PROPS)

(DEFMTRFUN ($NONZEROANDFREEOF $BOOLEAN MDEFINE NIL NIL) ($X $E) NIL
	   (AND (NOT (LIKE $E 0)) (MFUNCTION-CALL $FREEOF $X $E)))

(DEFPROP $LCM T TRANSLATED)

(ADD2LNC '$LCM $PROPS)

(DEFMTRFUN
  ($LCM $ANY MDEFINE T NIL) ($LIST) NIL
  ((LAMBDA ($LISTCONSTVARS)
     NIL
     (COND
       ((LIKE (SIMPLIFY (MFUNCTION-CALL $LISTOFVARS $LIST)) '((MLIST)))
	  (SIMPLIFY (MFUNCTION-CALL $LCM1 $LIST)))
       (T (SIMPLIFY (MFUNCTION-CALL
		      $FACTOR (SIMPLIFY (MFUNCTION-CALL $LCM1 $LIST)))))))
   NIL))

(DEFPROP $LCM1 T TRANSLATED)

(ADD2LNC '$LCM1 $PROPS)

(DEFMTRFUN
 ($LCM1 $ANY MDEFINE NIL NIL) ($LIST) NIL
 (COND
  ((LIKE $LIST '((MLIST))) 1)
  (T
   ((LAMBDA ($RLIST $FLIST $FRLIST $PARTSWITCH $INFLAG $PIECE)
      NIL
      (COND
	((LIKE $RLIST '((MLIST))) $FLIST)
	(T
	  (SIMPLIFY
	    (MFUNCTION-CALL
	      $LCM1
	      (SIMPLIFY
		(MFUNCTION-CALL
		  $CONS
		  (DIV
		    (MUL* $FLIST (SETQ $FRLIST (SIMPLIFY ($FIRST $RLIST))))
		    (SIMPLIFY (MFUNCTION-CALL $GCD $FLIST $FRLIST)))
		  (SIMPLIFY (MFUNCTION-CALL $REST $RLIST)))))))))
    (SIMPLIFY (MFUNCTION-CALL $REST $LIST))
    (SIMPLIFY ($FIRST $LIST)) '$FRLIST T T '$PIECE))))

(DEFPROP $GCDIVIDE T TRANSLATED)

(ADD2LNC '$GCDIVIDE $PROPS)

(DEFMTRFUN
  ($GCDIVIDE $ANY MDEFINE NIL NIL) ($POLY1 $POLY2) NIL
  ((LAMBDA ($GCDLIST)
     NIL
     (SETQ
       $GCDLIST (COND ((TRD-MSYMEVAL $TAKEGCD NIL)
			 (SIMPLIFY (MFUNCTION-CALL $EZGCD $POLY1 $POLY2)))
		      (T (LIST '(MLIST) 1 $POLY1 $POLY2))))
     (DIV (MARRAYREF $GCDLIST 2) (MARRAYREF $GCDLIST 3)))
   '$GCDLIST))

(DEFPROP $ARITHMETIC T TRANSLATED)

(ADD2LNC '$ARITHMETIC $PROPS)

(DEFMTRFUN ($ARITHMETIC $ANY MDEFINE NIL NIL) ($A $D $N)
	   NIL (ADD* $A (MUL* (ADD* $N -1) $D)))

(DEFPROP $GEOMETRIC T TRANSLATED)

(ADD2LNC '$GEOMETRIC $PROPS)

(DEFMTRFUN ($GEOMETRIC $ANY MDEFINE NIL NIL) ($A $R $N)
	   NIL (MUL* $A (POWER $R (ADD* $N -1))))

(DEFPROP $HARMONIC T TRANSLATED)

(ADD2LNC '$HARMONIC $PROPS)

(DEFMTRFUN ($HARMONIC $ANY MDEFINE NIL NIL) ($A $B $C $N)
	   NIL (DIV $A (ADD* $B (MUL* (ADD* $N -1) $C))))

(DEFPROP $ARITHSUM T TRANSLATED)

(ADD2LNC '$ARITHSUM $PROPS)

(DEFMTRFUN ($ARITHSUM $ANY MDEFINE NIL NIL) ($A $D $N) NIL
	   (MUL* $N (ADD* $A (DIV (MUL* (ADD* $N -1) $D) 2))))

(DEFPROP $GEOSUM T TRANSLATED)

(ADD2LNC '$GEOSUM $PROPS)

(DEFMTRFUN ($GEOSUM $ANY MDEFINE NIL NIL) ($A $R $N) NIL
	   (COND ((LIKE $N '$INF) (DIV $A (ADD* 1 (*MMINUS $R))))
		 (T (DIV (MUL* $A (ADD* 1 (*MMINUS (POWER $R $N))))
			 (ADD* 1 (*MMINUS $R))))))

(DEFPROP $GAUSSPROB T TRANSLATED)

(ADD2LNC '$GAUSSPROB $PROPS)

(DEFMTRFUN ($GAUSSPROB $ANY MDEFINE NIL NIL) ($X) NIL
	   (MUL* (DIV 1 (SIMPLIFY (LIST '(%SQRT) (MUL* 2 '$%PI))))
		 (SIMPLIFY ($EXP (DIV (*MMINUS (POWER $X 2)) 2)))))

(DEFPROP $GD T TRANSLATED)

(ADD2LNC '$GD $PROPS)

(DEFMTRFUN
 ($GD $ANY MDEFINE NIL NIL) ($X) NIL
 (MUL*
   2
   (SIMPLIFY
     (LIST '(%ATAN) (ADD* (SIMPLIFY ($EXP $X)) (*MMINUS (DIV '$%PI 2)))))))

(DEFPROP $AGD T TRANSLATED)

(ADD2LNC '$AGD $PROPS)

(DEFMTRFUN
  ($AGD $ANY MDEFINE NIL NIL) ($X) NIL
  (SIMPLIFY
    (LIST
      '(%LOG) (SIMPLIFY (LIST '(%TAN) (ADD* (DIV '$%PI 4) (DIV $X 2)))))))

(DEFPROP $VERS T TRANSLATED)

(ADD2LNC '$VERS $PROPS)

(DEFMTRFUN ($VERS $ANY MDEFINE NIL NIL) ($X) NIL
	   (ADD* 1 (*MMINUS (SIMPLIFY (LIST '(%COS) $X)))))

(DEFPROP $COVERS T TRANSLATED)

(ADD2LNC '$COVERS $PROPS)

(DEFMTRFUN ($COVERS $ANY MDEFINE NIL NIL) ($X) NIL
	   (ADD* 1 (*MMINUS (SIMPLIFY (LIST '(%SIN) $X)))))

(DEFPROP $EXSEC T TRANSLATED)

(ADD2LNC '$EXSEC $PROPS)

(DEFMTRFUN ($EXSEC $ANY MDEFINE NIL NIL) ($X) NIL
	   (ADD* (SIMPLIFY (LIST '(%SEC) $X)) -1))

(DEFPROP $HAV T TRANSLATED)

(ADD2LNC '$HAV $PROPS)

(DEFMTRFUN ($HAV $ANY MDEFINE NIL NIL) ($X) NIL
	   (DIV (ADD* 1 (*MMINUS (SIMPLIFY (LIST '(%COS) $X)))) 2))

(DEFPROP $COMBINATION T TRANSLATED)

(ADD2LNC '$COMBINATION $PROPS)

(DEFMTRFUN ($COMBINATION $ANY MDEFINE NIL NIL) ($N $R)
	   NIL (SIMPLIFY (LIST '(%BINOMIAL) $N $R)))

(DEFPROP $PERMUTATION T TRANSLATED)

(ADD2LNC '$PERMUTATION $PROPS)

(DEFMTRFUN ($PERMUTATION $ANY MDEFINE NIL NIL) ($N $R)
	   NIL (MUL* (SIMPLIFY (LIST '(%BINOMIAL) $N $R))
		     (SIMPLIFY (LIST '(MFACTORIAL) $R))))

(compile-forms-to-compile-queue)

