PROGRAM FILE 117: ACCURACY OF SQR FUNCTION.                                     
    ANSI STANDARD 7.6, 8.4                                                      
                                                                                
SECTION 117.1: ACCURACY OF SQR FUNCTION.                                        
                                                                                
THIS PROGRAM TESTS VALUES RETURNED BY INVOCATIONS OF THE                        
SQR FUNCTION FOR ACCURACY. THE INVOCATION MUST RETURN,                          
ACCURATE TO SIX DIGITS, SOME VALUE ACTUALLY TAKEN ON BY                         
THE FUNCTION WITHIN A DOMAIN BOUNDED BY THE ACTUAL ARGUMENT                     
PLUS OR MINUS ONE IN THE SIXTH DIGIT. ALSO, AN                                  
'ERROR MEASURE' IS COMPUTED AND REPORTED. THIS MEASURE                          
IS JUST 2 * THE ABSOLUTE ERROR OVER THE SIZE OF THE RANGE;                      
THUS, A VALUE JUST BARELY PASSING OR FAILING WILL USUALLY                       
HAVE A MEASURE OF ABOUT 1. A VALUE 3 TIMES                                      
AS INACCURATE AS EXPECTED WILL HAVE A MEASURE OF 3.                             
                                                                                
THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD                          
DOES NOT MANDATE ANY ACCURACY FOR SUPPLIED-FUNCTIONS.                           
                                                                                
              BEGIN TEST                                                        
                                                                                
ARGUMENT       TRUE           COMPUTED       ERROR          OUTCOME             
               VALUE          VALUE          MEASURE                            
                                                                                
 0              0              0             RANGE ZERO      OK  - EXACT        
 1.E-38         1.E-19         1.E-19         1.55307E-11    OK                 
 9.99999E-38    3.16228E-19    3.16228E-19    1.47321E-4     OK                 
 9.E-38         3.E-19         3.E-19         7.21863E-11    OK                 
 9.99999E-37    1.E-18         9.99999E-19    3.85127E-8     OK                 
 9.99999E-31    1.E-15         9.99999E-16    1.25169E-7     OK                 
 1.23456E-20    1.11111E-10    1.11111E-10    4.68189E-4     OK                 
 6.54321E-5     8.08901E-3     8.08901E-3     3.93464E-4     OK                 
 .5             .707107        .707107        1.54491E-4     OK                 
 1              1              1              0              OK  - EXACT        
 .999999        1.             .999999        3.8459E-8      OK                 
 2              1.41421        1.41421        2.7788E-4      OK                 
 3              1.73205        1.73205        3.08127E-4     OK                 
 4              2              2              0              OK  - EXACT        
 5              2.23607        2.23607        3.45333E-4     OK                 
 9.99999        3.16228        3.16228        1.47321E-4     OK                 
 10             3.16228        3.16228        8.08739E-6     OK                 
 40000          200            200            0              OK  - EXACT        
 1.23456E+8     11111.1        11111.1        4.68189E-4     OK                 
 6.54321E+20    2.55797E+10    2.55797E+10    2.61354E-4     OK                 
 9.99999E+31    1.E+16         9.99999E+15    1.24938E-7     OK                 
 9.E+36         3.E+18         3.E+18         0              OK  - EXACT        
 1.E+38         1.E+19         1.E+19         0              OK  - EXACT        
                                                                                
*** INFORMATIVE TEST PASSED ***                                                 
                                                                                
               END TEST                                                         
                                                                                
END PROGRAM 117                                                                 
