Fortran Help

Choosing the correct machine for Scientific computing is very problem dependent. Speed and accuracy are both desirable characteristic of a machine, but the are frequently competing objectives.

Quad precision if Fortran (128 bit floating point)

Fortran 77 does not have a standard method of declaring high precision numbers. This leads to a few conversion problems we will refer to here. The usual way to specify quad precision is with the "REAL*16" fortran statment, the usual way to specify a quad precision litereral is with the "q" exponent notation, e.g, 0.5q0. This is the method we will assume for these programs.

If the generic name of any intrinsic function is used the compiler wih choose the appropriate specific name to match the type of the argument. This makes the code both more readable and easier to convert to another precision. Some programmers, however, prefer, to leave nothing to the compiler and explicitly use the specific name. For not intinsic funtion you must use the correct function to match all the argument types.

SingleDoubleQuad
DeclarationREALREAL*8REAL*16
Constant0.10.1d00.1q0
Specific function namealogdlogqlog
Generic function namelogloglog

Test machines

The four types of machine currently installed here at the University of Delaware as of June 1998 are:
strauss - Sun Ultra Enterprise 4000 (250 MHz UltraSPARC CPUs each with 4MB of Cache)
This machine has 128 bit IEEE compliant floating point numbers. This breaks down to - 1 sign bit - 15 exponent bits - 111 fraction bits. As in all IEEE floating point numbers, a normalized number does not store the leading bit, since it is always one, thus effectively the fraction is 112 bits. The IEEE standards also specify the way these numbers should be operated on with "guard bits" and rounding rules. The intent is to make the results from floating points calculations identical accross machines.

joplin - Cray Research J916/8-102 (200 MHz Cray-compatible CPU)
The Cray does not have standard floating point hardware. It has 60 bit and 120 bit numbers. When a Fortran program asks for REAL*16 it gets the 120 bit numbers. The compiler does not recognize the q notation to indicate a quad precision literal.

mozart - IBM RS/6000, model 990 (64KB data cache)
The rs/6000 series does have IEEE compliant 64 bit floating point numbers, but it handles quat precision by treating a REAL*16 number as two independtly normalized 64 bit numbers. In some cases this trick can delay the need to normalize the number and squeeze more bits out of the calculations, but this usually does not make up for the fact it does not use as many bits for the fraction. (This also means the range of the numbers the same for double and quad precision on mozart)
Mozart is scheduled to be decommissioned on June 30, 1998

gershwin - SGI Power Challenge XL system (R10000 CPU with 2MB cache)
The Power Challenge has quad precision in what is called "64 bit mode", and to get this mode you must use the "-64" option on the f77 compiler. If you try to compile a program in 32 bit mode which has REAL*16 or quad literals it warns you that it is not really doing what you asked for.

Accuracy test

To test the accuracy of the calculations we have a simple program to evaluate expression which require high accuracy. For example adding a small number to a large number and then subtracting off the large number.
ftest - for accuracy

Speed Test

To test he speed of these machine for quad precision we add the terms of a geometric series. The sum of the first 20 million terms of a geometric series can be computed with 20 million multiplies and adds or just one call the power function using the standard formula for the sum a geometric series. In this test all terms are between 0.5 and 1.0 so the roundoffs should be the same order of magnitude. We used Mathematica to find the "exact" answer which is used to compute the number of bits of precision the answer has after 20 million floating point roundings.
sumtest - for speed

Here are the result of sumtest with indri the Sun Ultrasparc 1 on my desk included for reference.

Summary of the sumtest results
MachineSeconds to complete Bits of precision
Mozart1392
Gershwin2092
Strauss7092
Joplin6975
Indri160392

Conclusions