<< 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
Got questions? Get instant answers now!

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.

Got questions? Get instant answers now!

Write a program to determine the number of digits of precision for REAL*4 and REAL*8 .

Got questions? Get instant answers now!

Write a program to demonstrate how summing an array forward to backward and backward to forward can yield a different result.

Got questions? Get instant answers now!

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?

Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  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.

Notification Switch

Would you like to follow the 'High performance computing' conversation and receive update notifications?

Ask