<< Chapter < Page | Chapter >> Page > |
Run the following code to count the number of inverses that are not perfectly accurate:
REAL*4 X,Y,Z
INTEGER II = 0
DO X=1.0,1000.0,1.0Y = 1.0 / X
Z = Y * XIF ( Z .NE. 1.0 ) THEN
I = I + 1ENDIF
ENDDOPRINT *,’Found ’,I
END
Change the type of the variables to
REAL*8
and repeat. Make sure to keep the optimization at a sufficiently low level (-00) to keep the compiler from eliminating the computations.
Write a program to determine the number of digits of precision for
REAL*4
and
REAL*8
.
Write a program to demonstrate how summing an array forward to backward and backward to forward can yield a different result.
Assuming your compiler supports varying levels of IEEE compliance, take a significant computational code and test its overall performance under the various IEEE compliance options. Do the results of the program change?
Notification Switch
Would you like to follow the 'High performance computing' conversation and receive update notifications?