;;; -*- Mode: Lisp; Package: Macsyma -*-
;;; Translated code for LMIVAX::MAX$DISK:[SHARE2]DIFFEQ.MC;4
;;; Written on 9/15/1984 01:39: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:[SHARE2]DIFFEQ.MC;4")

;;; General declarations required for translated MACSYMA code.

(DECLARE (SPECIAL $LISTARITH $ARGL $DIFFEQ_RUNTIME $X_WE_ARE_CALCULATING))

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

(DECLARE (SPECIAL $X_WE_ARE_CALCULATING))

(DECLARE (SPECIAL $DIFFEQ_RUNTIME))

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

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

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

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

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

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

(DEF-MTRVAR $ARGL '((MLIST)) 1)

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

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


(DEFPROP $FLOATCHECK T TRANSLATED)

(ADD2LNC '$FLOATCHECK $PROPS)

(DEFMTRFUN
  ($FLOATCHECK $ANY MDEFINE NIL NIL) ($X) NIL
  (PROGN
    NIL (SETQ $X ($FLOAT $X))
    (COND
      ((NOT (MFUNCTION-CALL $NUMBERP $X))
	 (SIMPLIFY
	   (MFUNCTION-CALL $ERROR $X '|&not a floating point number.|))))
    $X))

(MEVAL* '(($MODEDECLARE) (($FUNCTION) $FLOATCHECK) $FLOAT))

(MEVAL* '(($MODEDECLARE) $X_WE_ARE_CALCULATING $ANY))

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

(DEF-MTRVAR $X_WE_ARE_CALCULATING '|&WE ARE NOT CALCULATING|)

(MEVAL* '(($MODEDECLARE) $DIFFEQ_RUNTIME $ANY))

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

(DEF-MTRVAR
  $DIFFEQ_RUNTIME (SIMPLIFY (MAPPLY-TR '$STATUS '((MLIST) $RUNTIME))))

(DEFPROP $RUNGE1 T TRANSLATED)

(ADD2LNC '$RUNGE1 $PROPS)

(DEFMTRFUN
  ($RUNGE1 $ANY MDEFINE NIL NIL) ($F $X0 $X1 $H $Y0) NIL
  (PROGN NIL
	 (PROGN (SETQ $X0 (MFUNCTION-CALL $FLOATCHECK $X0))
		(SETQ $X1 (MFUNCTION-CALL $FLOATCHECK $X1))
		(SETQ $H (MFUNCTION-CALL $FLOATCHECK $H))
		(SETQ $Y0 (MFUNCTION-CALL $FLOATCHECK $Y0)))
	 (SIMPLIFY (MFUNCTION-CALL $RUNGE1_INTERNAL $F $X0 $X1 $H $Y0))))

(DEFPROP $RUNGE1_INTERNAL T TRANSLATED)

(ADD2LNC '$RUNGE1_INTERNAL $PROPS)

(DEFMTRFUN
 ($RUNGE1_INTERNAL $ANY MDEFINE NIL NIL)
 ($F $X0 $X1 $H $Y0) (DECLARE (FLONUM $Y0 $H $X1 $X0))
 (PROGN
   NIL
   ((LAMBDA ($Y_LIST $X_LIST $YP_LIST $K1 $K2 $K3 $K4)
      (DECLARE (FLONUM $K4 $K3 $K2 $K1))
      NIL
      (DO (($X $X0 (+$ $H $X))) ((> $X $X1) '$DONE)
	(SETQ $X_WE_ARE_CALCULATING $X)
	(SETQ $Y_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $Y0 $Y_LIST)))
	(SETQ $X_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $X $X_LIST)))
	(SETQ $K1 (MFUNCALL $F $X $Y0))
	(SETQ $YP_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $K1 $YP_LIST)))
	(SETQ $K1 (*$ $H $K1))
	(SETQ
	  $K2
	  (*$ $H
	      (MFUNCALL
		$F (+$ $X (|//$| $H 2.0d+0)) (+$ $Y0 (|//$| $K1 2.0d+0)))))
	(SETQ
	  $K3
	  (*$ $H
	      (MFUNCALL
		$F (+$ $X (|//$| $H 2.0d+0)) (+$ $Y0 (|//$| $K2 2.0d+0)))))
	(SETQ $K4 (*$ $H (MFUNCALL $F (+$ $X $H) (+$ $Y0 $K3))))
	(SETQ
	  $Y0
	  (+$
	    $Y0 (|//$| (+$ $K1 $K2) 6.0d+0) (|//$| (+$ $K2 $K3) 3.0d+0))))
      (SETQ $X_WE_ARE_CALCULATING '|&WE ARE NOT CALCULATING|)
      (LIST '(MLIST) (SIMPLIFY (MFUNCTION-CALL $REVERSE $X_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $Y_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $YP_LIST))))
    '((MLIST)) '((MLIST)) '((MLIST)) 0.0D+0 0.0D+0 0.0D+0 0.0D+0)))

(DEFPROP $RUNGE2 T TRANSLATED)

(ADD2LNC '$RUNGE2 $PROPS)

(DEFMTRFUN
  ($RUNGE2 $ANY MDEFINE NIL NIL) ($F $X0 $X1 $H $Y0 $YP0) NIL
  (PROGN
    NIL
    (PROGN (SETQ $X0 (MFUNCTION-CALL $FLOATCHECK $X0))
	   (SETQ $X1 (MFUNCTION-CALL $FLOATCHECK $X1))
	   (SETQ $H (MFUNCTION-CALL $FLOATCHECK $H))
	   (SETQ $Y0 (MFUNCTION-CALL $FLOATCHECK $Y0))
	   (SETQ $YP0 (MFUNCTION-CALL $FLOATCHECK $YP0)))
    (SIMPLIFY (MFUNCTION-CALL $RUNGE2_INTERNAL $F $X0 $X1 $H $Y0 $YP0))))

(DEFPROP $RUNGE2_INTERNAL T TRANSLATED)

(ADD2LNC '$RUNGE2_INTERNAL $PROPS)

(DEFMTRFUN
 ($RUNGE2_INTERNAL $ANY MDEFINE NIL NIL)
 ($F $X0 $X1 $H $Y0 $YP0) (DECLARE (FLONUM $YP0 $Y0 $H $X1 $X0))
 (PROGN
   NIL
   ((LAMBDA ($Y_LIST $X_LIST $YP_LIST $YPP_LIST $K1 $K2 $K3 $K4 $TEMP)
      (DECLARE (FLONUM $TEMP $K4 $K3 $K2 $K1))
      NIL
      (DO (($X $X0 (+$ $H $X))) ((> $X $X1) '$DONE)
	(SETQ $X_WE_ARE_CALCULATING $X)
	(SETQ $Y_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $Y0 $Y_LIST)))
	(SETQ $X_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $X $X_LIST)))
	(SETQ $YP_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $YP0 $YP_LIST)))
	(SETQ $K1 (MFUNCALL $F $X $Y0 $YP0))
	(SETQ $YPP_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $K1 $YPP_LIST)))
	(SETQ $K1 (*$ $H $K1))
	(SETQ
	  $K2
	  (*$
	    $H
	    (MFUNCALL
	      $F (+$ $X (|//$| $H 2.0d+0))
	      (+$ $Y0 (*$ (|//$| $H 2.0d+0) (+$ $YP0 (|//$| $K1 4.0d+0))))
	      (+$ $YP0 (|//$| $K1 2.0d+0)))))
	(SETQ
	  $K3
	  (*$
	    $H
	    (MFUNCALL
	      $F (+$ $X (|//$| $H 2.0d+0))
	      (+$ $Y0 (*$ (|//$| $H 2.0d+0) (+$ $YP0 (|//$| $K2 4.0d+0))))
	      (+$ $YP0 (|//$| $K2 2.0d+0)))))
	(SETQ
	  $K4
	  (*$ $H
	      (MFUNCALL
		$F (+$ $X $H) (+$ $Y0 (*$ $H (+$ $YP0 (|//$| $K3 2.0d+0))))
		(+$ $YP0 $K3))))
	(SETQ
	  $TEMP
	  (+$ $YP0 (|//$| (+$ $K1 (*$ 2.0d+0 (+$ $K2 $K3)) $K4) 6.0d+0)))
	(SETQ
	  $Y0 (+$ $Y0 (*$ $H (+$ $YP0 (|//$| (+$ $K1 $K2 $K3) 6.0d+0)))))
	(SETQ $YP0 $TEMP))
      (SETQ $X_WE_ARE_CALCULATING '|&WE ARE NOT CALCULATING|)
      (LIST '(MLIST) (SIMPLIFY (MFUNCTION-CALL $REVERSE $X_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $Y_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $YP_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $YPP_LIST))))
    '((MLIST)) '((MLIST)) '((MLIST)) '((MLIST))
    0.0D+0 0.0D+0 0.0D+0 0.0D+0 0.0D+0)))

(DEFPROP $RUNGEN T TRANSLATED)

(ADD2LNC '$RUNGEN $PROPS)

(DEFMTRFUN
  ($RUNGEN $ANY MDEFINE NIL NIL) ($FL $XA $XB $H $YAL) NIL
  (PROGN
    NIL
    ((LAMBDA ($ORDER)
       (DECLARE (FIXNUM $ORDER))
       NIL
       (COND ((NOT (= $ORDER (MFUNCTION-CALL $LENGTH $YAL)))
		(SIMPLIFY
		  (MFUNCTION-CALL
		    $ERROR '|&Wrong number of initial values| $FL $YAL))))
       (PROGN (SETQ $XA (MFUNCTION-CALL $FLOATCHECK $XA))
	      (SETQ $XB (MFUNCTION-CALL $FLOATCHECK $XB))
	      (SETQ $H (MFUNCTION-CALL $FLOATCHECK $H)))
       (SETQ $YAL (MAPLIST_TR '$FLOATCHECK $YAL))
       (SIMPLIFY (MFUNCTION-CALL $RUNGEN_INTERNAL $FL $XA $XB $H $YAL)))
     (MFUNCTION-CALL $LENGTH $FL))))

(DEFPROP $VAPPLY T TRANSLATED)

(ADD2LNC '$VAPPLY $PROPS)

(DEFMTRFUN
  ($VAPPLY $ANY MDEFINE NIL NIL) ($FL $ARGL) NIL
  (PROGN
    NIL NIL
    (MAPLIST_TR
      (M-TLAMBDA ($F) NIL NIL
		 (SIMPLIFY (MAPPLY-TR $F (TRD-MSYMEVAL $ARGL '((MLIST))))))
      $FL)))

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

(DEFPROP $RUNGEN_INTERNAL T TRANSLATED)

(ADD2LNC '$RUNGEN_INTERNAL $PROPS)

(DEFMTRFUN
 ($RUNGEN_INTERNAL $ANY MDEFINE NIL NIL)
 ($F $XA $XB $H $YA) (DECLARE (FLONUM $H $XB $XA))
 (PROGN
   NIL
   ((LAMBDA ($Y_LIST $X_LIST $YP_LIST $K1 $K2 $K3 $K4 $LISTARITH)
      NIL
      NIL
      (DO (($X $XA (+$ $H $X))) ((> $X $XB) '$DONE)
	(SETQ $X_WE_ARE_CALCULATING $X)
	(SETQ $Y_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $YA $Y_LIST)))
	(SETQ $X_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $X $X_LIST)))
	(SETQ
	  $K1 (SIMPLIFY
		(MFUNCTION-CALL
		  $VAPPLY $F (SIMPLIFY (MFUNCTION-CALL $CONS $X $YA)))))
	(SETQ $YP_LIST (SIMPLIFY (MFUNCTION-CALL $CONS $K1 $YP_LIST)))
	(SETQ $K1 (MUL* $H $K1))
	(SETQ
	  $K2
	  (MUL*
	    $H
	    (SIMPLIFY
	      (MFUNCTION-CALL
		$VAPPLY $F
		(SIMPLIFY (MFUNCTION-CALL $CONS (+$ $X (|//$| $H 2.0d+0))
					  (ADD* $YA (DIV $K1 2.0d+0))))))))
	(SETQ
	  $K3
	  (MUL*
	    $H
	    (SIMPLIFY
	      (MFUNCTION-CALL
		$VAPPLY $F
		(SIMPLIFY (MFUNCTION-CALL $CONS (+$ $X (|//$| $H 2.0d+0))
					  (ADD* $YA (DIV $K2 2.0d+0))))))))
	(SETQ
	  $K4
	  (MUL*
	    $H (SIMPLIFY
		 (MFUNCTION-CALL
		   $VAPPLY $F
		   (SIMPLIFY
		     (MFUNCTION-CALL $CONS (+$ $X $H) (ADD* $YA $K3)))))))
	(SETQ
	  $YA
	  (ADD*
	    $YA (DIV (ADD* $K1 $K2) 6.0d+0) (DIV (ADD* $K2 $K3) 3.0d+0))))
      (SETQ $X_WE_ARE_CALCULATING '|&WE ARE NOT CALCULATING|)
      (LIST '(MLIST) (SIMPLIFY (MFUNCTION-CALL $REVERSE $X_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $Y_LIST))
	    (SIMPLIFY (MFUNCTION-CALL $REVERSE $YP_LIST))))
    '((MLIST)) '((MLIST)) '((MLIST)) '((MLIST))
    '((MLIST)) '((MLIST)) '((MLIST)) T)))

(compile-forms-to-compile-queue)

