home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / tpl60n19.zip / ACCURACY.DOC next >
Text File  |  1993-02-13  |  5KB  |  98 lines

  1.                 Accuracy Comparison for REAL arithmetic
  2.  
  3.  
  4.                    TP 6.0 Turbo Pascal Library
  5.                               versus
  6.                 TP 6.0 Runtime Library Update 1.9
  7.  
  8.  
  9.  
  10. Test of basic arithmetic with FUN1_TST. 10,000,000 random trials per function
  11. Limit of relative error for full 40 bit accuracy is 9.094947022e-13.
  12.  
  13.                   TP 6.0 RTL                    TP 6.0 RLU 1.9
  14.  
  15.              % wrong   max. rel. error       % wrong   max. rel. error
  16.  
  17. ADD          0.2797%   1.808959156e-12       0.0000%   9.094820930e-13
  18. SUB          0.6520%   1.808959156e-12       0.0000%   9.094905407e-13
  19. MUL          0.0000%   9.089090757e-13       0.0000%   9.089090757e-13
  20. DIV          0.0000%   9.093327167e-13       0.0000%   9.093327167e-13
  21. Short-MUL *  2.5918%   4.080092079e-12       0.0000%   9.094466215e-13
  22.  
  23. * Short-MUL is a multiplication where one of the operands carries only 16
  24.   bits of precision (the last 24 mantissa bits are zero).
  25.  
  26.  
  27.  
  28. Test of higher math functions with ELEFUNT test programs. 1,000,000 random
  29. trials per function test.
  30.  
  31. MRE = maximum relative error
  32. RMS = root mean square relative error (average error)
  33.  
  34. Errors reported by ELEFUNT test programs tend to be larger than the actual
  35. error of the routines as compared to higher precision routines (coprocessor).
  36. This is due to the nature of the tests, which are based on functional
  37. identities. The additional computations in testing the identities cause
  38. additional round-off errors.
  39.  
  40.  
  41.                       TP 6.0 RTL                     TP 6.0 RLU 1.9
  42.  
  43.               % wrong    MRE         RMS        % wrong    MRE        RMS
  44.  
  45. DSQRT Test1   9.5168% 1.28622e-12 3.55691e-13   0.0000% 0.00000e+00 0.00000e+00
  46.       Test2   0.0004% 1.81880e-12 3.63514e-15   0.0000% 0.00000e+00 0.00000e+00
  47.  
  48. DSIN  Test1  48.5712% 7.27690e-12 1.23905e-12  38.4640% 2.64505e-12 7.22852e-13
  49.       Test2  84.1129% 4.11862e-04 4.11889e-07  44.0276% 8.00614e-09 8.04878e-12
  50. *     Test3  91.4008% 9.81763e-07 2.28067e-09  42.9703% 4.31878e-11 8.08930e-13
  51.  
  52. DATAN Test1  18.7839% 3.44114e-12 5.36085e-13  11.1927% 1.81897e-12 4.11701e-13
  53.       Test2  63.1260% 6.66016e-12 1.91192e-12  20.3286% 1.82093e-12 5.74504e-13
  54.       Test3  70.2866% 4.27213e-12 1.38748e-12  31.3874% 3.33085e-12 7.80409e-13
  55.       Test4  64.5424% 7.72474e-12 2.87544e-12  42.5229% 3.63782e-12 9.16674e-13
  56.  
  57. DEXP  Test1  51.1003% 4.86911e-12 1.12152e-12  29.3751% 2.93224e-12 7.09432e-13
  58.       Test2  99.4743% 6.14647e-11 2.34142e-11  30.0348% 2.95769e-12 7.24600e-13
  59.       Test3  99.7909% 6.09032e-11 2.82847e-11  30.5228% 2.94201e-12 7.30898e-13
  60.  
  61. DLOG  Test1  99.9991% 1.00000e+00 1.10905e-02  39.8793% 3.46234e-12 8.16947e-13
  62.       Test2  92.8802% 3.87388e-11 5.31959e-12  38.5649% 3.63262e-12 8.65898e-13
  63. **    Test3  73.2293% 2.84949e-11 2.72609e-12  62.3653% 5.44522e-12 1.36790e-12
  64.       Test4  22.3294% 1.81898e-12 6.51330e-13  11.5519% 2.32351e-12 4.31119e-13
  65.  
  66.  
  67. *  test of cosine function
  68. ** test of LOG10 function, here simulated by Ln(10) * Ln(X)
  69.  
  70.  
  71.  
  72. Comparison of the results returned by the higher math functions of the REAL
  73. arithmetic software routines with the results returned by a math coprocessor
  74. (Intel RapidCAD). 10,000,000 uniformly distributed arguments from the stated
  75. interval were used to test each function. Note that measuring the error in
  76. ULPs is a more accurate metric than simply measuring the relative error. An
  77. ideal function realization would have an error of exactly 0.5 ULPs.
  78.  
  79.  
  80.                            TP 6.0 RTL                     TP 6.0 RLU 1.9
  81.  
  82.          interval    % wrong        ULP error       % wrong        ULP error
  83.  
  84. EXP   -80.0 .. 80.0  94.5971% -67.8575 .. 68.3351   11.7913%  -1.5040 .. 1.4332
  85. LN    0.001 .. 20.0  90.5987% -1235543 .. 1376324   36.0809%  -1.8906 .. 2.1619
  86. SIN   -pi/2 .. pi/2  55.8652% -1258556 .. 1764088    8.1768%  -1.2873 .. 0.9709
  87. COS   -pi/2 .. pi/2  77.4390% -6865461 .. 1.36546 * 18.7039% -6914048 .. 1.3897
  88. ATAN  -20.0 .. 20.0  33.8899%  -4.4203 .. 2.16430   40.5660%  -1.7478 .. 1.3908
  89.  
  90. %wrong are those cases where the result returned by the REAL arithmetic 
  91.        software routines differ from the result returned by the coprocessor
  92.        and rounded to the precision of the REAL type.
  93.  
  94. *      the high error in the COS routine is caused by the loss of accuracy 
  95.        in the argument reduction. Loss of accuracy in the reduction process
  96.        for the SIN and COS functions can only prohibited at a relatively
  97.        high cost.
  98.