;;; -*- Mode: Lisp; Package: Macsyma -*-
;;; Translated code for LMIVAX::MAX$DISK:[SHARE1]RNCOMB.MC;1
;;; Written on 9/13/1984 03:20:28, 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:[SHARE1]RNCOMB.MC;1")

;;; General declarations required for translated MACSYMA code.

(DECLARE (SPECIAL $PFEFORMAT $PIECE $INFLAG $PARTSWITCH))

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

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

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

(PUTPROP 'MAPLIST_TR (OR (GET 'MARRAYREF 'AUTOLOAD) T) 'AUTOLOAD)

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

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

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


(SIMPLIFY (MFUNCTION-CALL $PUT '$RNCOMB 2 '$VERSION))

(DEFPROP $RNCOMBINE T TRANSLATED)

(ADD2LNC '$RNCOMBINE $PROPS)

(DEFMTRFUN
 ($RNCOMBINE $ANY MDEFINE NIL NIL) ($EXP) NIL
 ((LAMBDA ($PARTSWITCH $INFLAG $PIECE $PFEFORMAT)
    NIL
    (SETQ
      $EXP
      (SIMPLIFY (MFUNCTION-CALL
		  $RLOIEWL '&+ (SIMPLIFY (MFUNCTION-CALL $COMBINE $EXP)))))
    (SETQ $PFEFORMAT NIL)
    (SIMPLIFY (MFUNCTION-CALL $RNCOMBINE1 $EXP)))
  T T '$PIECE T))

(DEFPROP $LCM_L T TRANSLATED)

(ADD2LNC '$LCM_L $PROPS)

(DEFMTRFUN
 ($LCM_L $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
	      $LCM_L
	      (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 $RNCOMBINE1 T TRANSLATED)

(ADD2LNC '$RNCOMBINE1 $PROPS)

(DEFMTRFUN
 ($RNCOMBINE1 $ANY MDEFINE NIL NIL) ($LIST) NIL
 ((LAMBDA ($FLIST $SPLITDUM $LSPLITDUM $FLIST_DENOM)
    NIL
    (PROG ()
       (COND ((LIKE $LIST '((MLIST))) (RETURN 0)))
       (SETQ $FLIST (SIMPLIFY ($FIRST $LIST)))
       (COND
	 ((= (MFUNCTION-CALL $LENGTH $LIST) 1)
	    (RETURN
	      (COND
		((LIKE
		   (SIMPLIFY (MFUNCTION-CALL
			       $INPART
			       (SIMPLIFY (MFUNCTION-CALL $NUM $FLIST)) 0))
		   '&+)
		   (DIV (SIMPLIFY
			  (MFUNCTION-CALL
			    $RNCOMBINE1
			    (SIMPLIFY
			      (MFUNCTION-CALL
				$ARGS
				(SIMPLIFY (MFUNCTION-CALL $NUM $FLIST))))))
			(SIMPLIFY (MFUNCTION-CALL $DENOM $FLIST))))
		(T $FLIST)))))
       (SETQ
	 $FLIST_DENOM
	 (DIV
	   (SETQ $FLIST_DENOM (SIMPLIFY (MFUNCTION-CALL $DENOM $FLIST)))
	   (SIMPLIFY (MFUNCTION-CALL $NUMFACTOR $FLIST_DENOM))))
       (SETQ $FLIST (MUL* $FLIST $FLIST_DENOM))
       (SETQ
	 $SPLITDUM
	 (SIMPLIFY
	   (MFUNCTION-CALL
	     $PREDPARTITION (SIMPLIFY (MFUNCTION-CALL $REST $LIST))
	     (M-TLAMBDA&ENV
	       (($DUM) ($FLIST_DENOM)) NIL
	       (MFUNCTION-CALL
		 $NUMBERP (DIV (SIMPLIFY (MFUNCTION-CALL $DENOM $DUM))
			       $FLIST_DENOM))))))
       (COND
	 ((NOT (LIKE
		 (SETQ
		   $LSPLITDUM (SIMPLIFY (MFUNCTION-CALL $LAST $SPLITDUM)))
		 '((MLIST))))
	    (SETQ
	      $FLIST
	      (DIV (SIMPLIFY
		     (MFUNCTION-CALL
		       $DENOMTHRU
		       (SIMPLIFY
			 (MFUNCTION-CALL
			   $CONS $FLIST (MUL* $LSPLITDUM $FLIST_DENOM)))))
		   $FLIST_DENOM))))
       (RETURN
	 (ADD* $FLIST
	       (SIMPLIFY (MFUNCTION-CALL
			   $RNCOMBINE1 (SIMPLIFY ($FIRST $SPLITDUM))))))))
  '$FLIST '$SPLITDUM '$LSPLITDUM '$FLIST_DENOM))

(DEFPROP $DENOMTHRU T TRANSLATED)

(ADD2LNC '$DENOMTHRU $PROPS)

(DEFMTRFUN
  ($DENOMTHRU $ANY MDEFINE NIL NIL) ($EXP) NIL
  ((LAMBDA ($LCMDUM)
     NIL (DIV (SIMPLIFY (MAPPLY-TR '&+ (MUL* $LCMDUM $EXP))) $LCMDUM))
   (SIMPLIFY (MFUNCTION-CALL $LCM_L (MAPLIST_TR '$DENOM $EXP)))))

(DEFPROP $RLOIEWL T TRANSLATED)

(ADD2LNC '$RLOIEWL $PROPS)

(DEFMTRFUN
  ($RLOIEWL $ANY MDEFINE NIL NIL) ($OP $EXP) NIL
  ((LAMBDA ($PARTSWITCH $INFLAG $PIECE)
     NIL (COND ((LIKE (SIMPLIFY (MFUNCTION-CALL $INPART $EXP 0)) $OP)
		  (SIMPLIFY (MFUNCTION-CALL $ARGS $EXP)))
	       (T (LIST '(MLIST) $EXP))))
   T T '$PIECE))

(DEFPROP $PREDPARTITION T TRANSLATED)

(ADD2LNC '$PREDPARTITION $PROPS)

(DEFMTRFUN
 ($PREDPARTITION $ANY MDEFINE NIL NIL) ($LIST $PREDICATE) NIL
 ((LAMBDA ($NOLIST $YESLIST)
    NIL
    (DO (($IDUM)
	 (MDO (CDR (SIMPLIFY (MFUNCTION-CALL $REVERSE $LIST))) (CDR MDO)))
	((NULL MDO) '$DONE)
      (SETQ $IDUM (CAR MDO))
      (COND
	((SIMPLIFY (MFUNCALL $PREDICATE $IDUM))
	   (SETQ
	     $YESLIST (SIMPLIFY (MFUNCTION-CALL $CONS $IDUM $YESLIST))))
	(T
	  (SETQ $NOLIST (SIMPLIFY (MFUNCTION-CALL $CONS $IDUM $NOLIST))))))
    (LIST '(MLIST) $NOLIST $YESLIST))
  '((MLIST)) '((MLIST))))

(compile-forms-to-compile-queue)

