(FILECREATED " 9-Dec-86 15:58:09" {QV}<PEDERSEN>LISP>TEST-UNBOXED-FLOAT-OPS.;2 8232   

      changes to:  (FNS RUN-UNBOXED-FLOAT-BENCHMARKS TEST.UFTIMES TEST.UFPLUS TEST.UFDIFFERENCE 
			TEST.UFQUOTIENT TEST.UFMINUS TEST.UFMIN TEST.UFMAX TEST.UFIX TEST.UFABS 
			TEST.UFGREATERP TEST.POLYNOM PRINT-UNBOXED-FLOAT-BENCHMARK SETUP-ARRAY)
		   (VARS TEST-UNBOXED-FLOATCOMS UNBOXED-FLOATOPS-TESTS TEST-UNBOXED-FLOAT-OPSCOMS 
			 POLYARRAYLST)

      previous date: " 8-Dec-86 12:59:44" {QV}<PEDERSEN>LISP>TEST-UNBOXED-FLOAT.;3)


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT TEST-UNBOXED-FLOAT-OPSCOMS)

(RPAQQ TEST-UNBOXED-FLOAT-OPSCOMS ((FNS PRINT-UNBOXED-FLOAT-BENCHMARK RUN-UNBOXED-FLOAT-BENCHMARKS 
					  SETUP-ARRAY TEST.POLYNOM TEST.UFABS TEST.UFDIFFERENCE 
					  TEST.UFGREATERP TEST.UFIX TEST.UFMAX TEST.UFMIN 
					  TEST.UFMINUS TEST.UFPLUS TEST.UFQUOTIENT TEST.UFTIMES)
	(VARS POLYARRAYLST UNBOXED-FLOATOPS-TESTS)
	(FILES (FROM VALUEOF DIRECTORIES)
	       CMLARRAY)
	(FILES (FROM VALUEOF DIRECTORIES)
	       UNBOXEDOPS)
	(FILES (FROM {QV}<PEDERSEN>LISP>)
	       ARRAYSUPPORT)))
(DEFINEQ

(PRINT-UNBOXED-FLOAT-BENCHMARK
  [LAMBDA (F ARGS)                                           (* edited: " 9-Dec-86 15:22")
    (LET ((TESTFN (PACK* (QUOTE TEST.)
			   F)))
         (PRINTOUT T T "***************" , F , "Benchmark ******************" T T)
         (PRINTOUT T T T "Starting the" , F , "test" T T)
         (SETQ VALUE (TIMEALL (APPLY TESTFN ARGS)))
         (PRINTOUT T "Value is" , VALUE T T)
         (PRINTOUT T "Releasing working set" T T)
         (\RELEASEWORKINGSET)
         (PRINTOUT T T "Repeating the TIMEALL" T T)
         (SETQ VALUE (TIMEALL (APPLY TESTFN ARGS)))
         (PRINTOUT T "Value is" , VALUE T T)
         (RECLAIM)
         (PRINTOUT T T F , "Finished" T T])

(RUN-UNBOXED-FLOAT-BENCHMARKS
  [LAMBDA (BENCHMARKS NO-DRIBBLE?)                           (* edited: " 9-Dec-86 15:37")

          (* * BENCHMARKS should be a list of the desired Benchmarks)


    (DECLARE (GLOBALVARS UNBOXED-FLOATOPS-TESTS))
    (if (NULL BENCHMARKS)
	then (SETQ BENCHMARKS UNBOXED-FLOATOPS-TESTS))
    (if (ASSOC (QUOTE POLYNOM)
		   BENCHMARKS)
	then (SETUP-ARRAY POLYARRAYLST))
    (RESETLST (LET ((DRIBBLE.FILE (PACKFILENAME (QUOTE HOST)
						    (QUOTE DSK)
						    (QUOTE NAME)
						    (PACK* MAKESYSNAME "-" (MACHINETYPE)
							     "-UNBOXEDFLOATOPS")
						    (QUOTE EXTENSION)
						    (QUOTE BENCHMARKS)))
		      VALUE)
		     (DECLARE (SPECVARS VALUE))
		     (RESETSAVE NIL (QUOTE (TERPRI)))
		     (RESETSAVE *PRINT-ARRAY* T)
		     [AND (NULL NO-DRIBBLE?)
			    (RESETSAVE NIL (LIST (QUOTE PRIN1)
						     (CONCAT "Test Results in " DRIBBLE.FILE]
		     (AND (NULL NO-DRIBBLE?)
			    (RESETSAVE (DRIBBLE DRIBBLE.FILE)))
		     (MOVD (QUOTE PAGEFULLFN)
			     (QUOTE PAGEFULLFN.SAVE))
		     (RESETSAVE NIL (QUOTE (MOVD PAGEFULLFN.SAVE PAGEFULLFN)))
		     (MOVD (QUOTE NILL)
			     (QUOTE PAGEFULLFN))
		     (printout T T "MACHINETYPE = " (MACHINETYPE)
			       T)
		     (printout T T "MAKESYSNAME = " MAKESYSNAME T)
		     (printout T T "MAKESYSDATE = " MAKESYSDATE T)
		     (printout T T "DATE = " (DATE)
			       T)
		     (printout T T "USERNAME = " (USERNAME)
			       T T)
		     (for BM in BENCHMARKS do (PRINT-UNBOXED-FLOAT-BENCHMARK (CAR BM)
										     (CADR BM)))
		     (PRINTOUT T "Finished benchmarking" T T])

(SETUP-ARRAY
  [LAMBDA (LST)                                              (* edited: " 9-Dec-86 15:13")
    (DECLARE (GLOBALVARS POLYARRAY))
    (SETQ POLYARRAY (MAKE-ARRAY (LENGTH LST)
				    (QUOTE :ELEMENT-TYPE)
				    (QUOTE FLOAT)
				    (QUOTE :INITIAL-CONTENTS)
				    LST])

(TEST.POLYNOM
  [LAMBDA (TEST)                                             (* edited: " 9-Dec-86 15:14")
    (DECLARE (GLOBALVARS POLYARRAY))
    (LET ((BASE (ARRAYBASE POLYARRAY))
	  (ORDER (SUB1 (ARRAY-TOTAL-SIZE POLYARRAY)))
	  RESULT)
         (DECLARE (TYPE FLOATP RESULT))
         (SETQ RESULT (\POLYNOM 1.0 BASE ORDER))
         (FEQP RESULT TEST])

(TEST.UFABS
  [LAMBDA (X TEST)                                           (* edited: " 9-Dec-86 14:53")
    (LET ((FX (FLOAT X))
	  RESULT)
         (DECLARE (TYPE FLOATP FX RESULT))
         (SETQ RESULT (UFABS FX))
         (FEQP RESULT TEST])

(TEST.UFDIFFERENCE
  [LAMBDA (X Y TEST)                                         (* edited: " 9-Dec-86 15:18")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY RESULT))
         (SETQ RESULT (FDIFFERENCE FX FY))
         (FEQP RESULT TEST])

(TEST.UFGREATERP
  [LAMBDA (X Y TEST)                                         (* edited: " 9-Dec-86 14:55")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY))
         (SETQ RESULT (UFGREATERP FX FY))
         (EQ RESULT TEST])

(TEST.UFIX
  [LAMBDA (X TEST)                                           (* edited: " 9-Dec-86 14:53")
    (LET ((FX (FLOAT X))
	  RESULT)
         (DECLARE (TYPE FLOATP FX RESULT))
         (SETQ RESULT (UFIX FX))
         (FEQP RESULT TEST])

(TEST.UFMAX
  [LAMBDA (X Y Z TEST)                                       (* edited: " 9-Dec-86 14:53")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  (FZ (FLOAT Z))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY FZ RESULT))
         (SETQ RESULT (UFMAX FX FY FZ))
         (FEQP RESULT TEST])

(TEST.UFMIN
  [LAMBDA (X Y Z TEST)                                       (* edited: " 9-Dec-86 14:52")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  (FZ (FLOAT Z))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY FZ RESULT))
         (SETQ RESULT (UFMIN FX FY FZ))
         (FEQP RESULT TEST])

(TEST.UFMINUS
  [LAMBDA (X TEST)                                           (* edited: " 9-Dec-86 14:51")
    (LET ((FX (FLOAT X))
	  RESULT)
         (DECLARE (TYPE FLOATP FX RESULT))
         (SETQ RESULT (UFMINUS FX))
         (FEQP RESULT TEST])

(TEST.UFPLUS
  [LAMBDA (X Y Z TEST)                                       (* edited: " 9-Dec-86 14:48")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  (FZ (FLOAT Z))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY FZ RESULT))
         (SETQ RESULT (FPLUS FX FY FZ))
         (FEQP RESULT TEST])

(TEST.UFQUOTIENT
  [LAMBDA (X Y TEST)                                         (* edited: " 9-Dec-86 15:06")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY RESULT))
         (SETQ RESULT (FQUOTIENT FX FY))
         (FEQP RESULT TEST])

(TEST.UFTIMES
  [LAMBDA (X Y Z TEST)                                       (* edited: " 9-Dec-86 14:47")
    (LET ((FX (FLOAT X))
	  (FY (FLOAT Y))
	  (FZ (FLOAT Z))
	  RESULT)
         (DECLARE (TYPE FLOATP FX FY FZ RESULT))
         (SETQ RESULT (FTIMES FX FY FZ))
         (FEQP RESULT TEST])
)

(RPAQQ POLYARRAYLST (1.0 2.0 3.0 4.0 5.0))

(RPAQQ UNBOXED-FLOATOPS-TESTS ((UFPLUS (1.0 1.0 1.0 3.0))
				 (UFDIFFERENCE (1.0 1.0 0.0))
				 (UFTIMES (1.0 2.0 3.0 6.0))
				 (UFQUOTIENT (4.0 2.0 2.0))
				 (UFGREATERP (2.0 3.0 NIL))
				 (UFGREATERP (5.0 3.0 T))
				 (UFGREATERP (3.0 3.0 NIL))
				 (UFABS (-2.0 2.0))
				 (UFMINUS (-2.0 2.0))
				 (UFIX (2.0 2))
				 (UFMAX (1.0 2.0 3.0 3.0))
				 (UFMIN (1.0 2.0 3.0 1.0))
				 (POLYNOM (15.0))))
(FILESLOAD (FROM VALUEOF DIRECTORIES)
	   CMLARRAY)
(FILESLOAD (FROM VALUEOF DIRECTORIES)
	   UNBOXEDOPS)
(FILESLOAD (FROM {QV}<PEDERSEN>LISP>)
	   ARRAYSUPPORT)
(PUTPROPS TEST-UNBOXED-FLOAT-OPS COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1139 7517 (PRINT-UNBOXED-FLOAT-BENCHMARK 1149 . 1898) (RUN-UNBOXED-FLOAT-BENCHMARKS 
1900 . 3709) (SETUP-ARRAY 3711 . 4036) (TEST.POLYNOM 4038 . 4438) (TEST.UFABS 4440 . 4712) (
TEST.UFDIFFERENCE 4714 . 5027) (TEST.UFGREATERP 5029 . 5330) (TEST.UFIX 5332 . 5602) (TEST.UFMAX 5604
 . 5932) (TEST.UFMIN 5934 . 6262) (TEST.UFMINUS 6264 . 6540) (TEST.UFPLUS 6542 . 6871) (
TEST.UFQUOTIENT 6873 . 7182) (TEST.UFTIMES 7184 . 7515)))))
STOP