blob: 9eff54e1bb201492e95d0b396a2adb14981c8f6b [file] [log] [blame]
/*
* C Converted Whetstone Double Precision Benchmark
* Version 1.2 22 March 1998
*
* (c) Copyright 1998 Painter Engineering, Inc.
* All Rights Reserved.
*
* Permission is granted to use, duplicate, and
* publish this text and program as long as it
* includes this entire comment block and limited
* rights reference.
*
* Converted by Rich Painter, Painter Engineering, Inc. based on the
* www.netlib.org benchmark/whetstoned version obtained 16 March 1998.
*
* A novel approach was used here to keep the look and feel of the
* FORTRAN version. Altering the FORTRAN-based array indices,
* starting at element 1, to start at element 0 for C, would require
* numerous changes, including decrementing the variable indices by 1.
* Instead, the array E1[] was declared 1 element larger in C. This
* allows the FORTRAN index range to function without any literal or
* variable indices changes. The array element E1[0] is simply never
* used and does not alter the benchmark results.
*
* The major FORTRAN comment blocks were retained to minimize
* differences between versions. Modules N5 and N12, like in the
* FORTRAN version, have been eliminated here.
*
* An optional command-line argument has been provided [-c] to
* offer continuous repetition of the entire benchmark.
* An optional argument for setting an alternate LOOP count is also
* provided. Define PRINTOUT to cause the POUT() function to print
* outputs at various stages. Final timing measurements should be
* made with the PRINTOUT undefined.
*
* Questions and comments may be directed to the author at
* r.painter@ieee.org
*/
/*
C**********************************************************************
C Benchmark #2 -- Double Precision Whetstone (A001)
C
C o This is a REAL*8 version of
C the Whetstone benchmark program.
C
C o DO-loop semantics are ANSI-66 compatible.
C
C o Final measurements are to be made with all
C WRITE statements and FORMAT sttements removed.
C
C**********************************************************************
*/