This page is optimized for mobile devices, if you would prefer the desktop version just
click here
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?
OpenStax, High performance computing. OpenStax CNX. Aug 25, 2010 Download for free at http://cnx.org/content/col11136/1.5
Google Play and the Google Play logo are trademarks of Google Inc.