ANS FORTH CELEFUNT TEST RESULTS FOR Z^ zpow.fs vs. 0.9.3 dnw 18Jan05 These results were obtained with pfe 0.33.58 compiled with gcc 3.3.3 on my MacOS X 10.3.7, PowerMac dual G4 system. Leaving aside the pfe C-primitive tests, Gforth 0.6.2 gives the same results as pfe on the same system, except for the way NaN and Inf are treated. Results from Cody's original Fortran code are included for reference. It was compiled with GNU Fortran (GCC) 3.4 20031015 (experimental) under MacOS X. The "normal" version calls complex.fs vs. 0.8.2, Julian Noble's original code for Z^. The "kahan" version calls complex-kahan.fs vs. 0.8.7, which uses the Kahan algorithm without treatment of IEEE 754 underflow/overflow exceptions. The "pfe prim" version calls the pfe complex module vs. 0.8.7, which codes the Kahan algorithm in C with treatment of underflow/overflow exceptions. This module is part of the pfe 0.33.xx series distribution. Each test has three sections corresponding to the magnitude of the relative complex difference of the compared functions, the relative error in the real part, and the relative error in the imaginary part. N= = number out of 2000 random trials that are equal MRE = maximum relative error RMS = rms relative error ULP = estimated units in last place (loss of base 2 significant digits) Floating point numbers have 53 significant bits, with at most 7 significant decimal digits printed out below. The complex numbers following "box" are opposite corners of the box in the complex plane from which random values of z are chosen. z^[1+i0] vs. z, box 1+i0, 10+i10 N= MRE ULP RMS ULP vector g77 395 4.70E-16 2.08 1.63E-16 0.56 normal 224 4.60E-16 2.05 1.76E-16 0.66 kahan 226 4.48E-16 2.01 1.66E-16 0.58 pfe prim 392 4.83E-16 2.12 1.58E-16 0.51 real g77 776 9.91E-16 3.16 1.95E-16 0.81 normal 761 9.90E-16 3.16 2.02E-16 0.86 kahan 777 1.31E-15 3.56 2.27E-16 1.03 pfe prim 772 1.53E-15 3.78 2.27E-16 1.03 imaginary g77 767 5.70E-16 2.36 1.67e-16 0.58 normal 610 8.63E-14 9.60 2.66E-15 4.58 kahan 671 8.63E-14 9.60 2.66E-15 4.58 pfe prim 843 5.90E-16 2.41 1.57E-16 0.50 z^[2+i0] vs. z*z, box 1+i0, 10+i10 N= MRE ULP RMS ULP vector g77 141 1.00E-15 3.18 2.95E-16 1.41 normal 68 9.56E-16 3.11 3.22E-16 1.54 kahan 77 6.72E-16 2.60 2.86E-16 1.36 pfe prim 152 7.50E-16 2.76 2.75E-16 1.31 real g77 340 2.62E-15 4.56 4.43E-16 2.00 normal 311 6.51E-15 5.87 7.21E-16 2.70 kahan 361 6.51E-15 5.87 7.65E-16 2.78 pfe prim 374 5.04E-15 5.51 5.43E-16 2.29 imaginary g77 424 1.17E-15 3.39 3.06E-16 1.46 normal 376 6.35E-14 9.16 2.05E-15 4.21 kahan 398 6.35E-14 9.16 2.04E-15 4.20 pfe prim 449 1.56E-15 3.81 2.92E-16 1.39 z^w vs. [z*z]^[w/2], box 4+i4, 10+i10 ***************************************************** * Very large MRE values are the norm for this test; * * the frequency of exact agreement is meaningful. * ***************************************************** N= MRE ULP RMS ULP vector g77 1302 8.12E-15 6.19 2.18E-15 4.30 normal 1467 2.02E-14 7.51 2.82E-15 4.67 kahan 1725 1.00E-14 6.50 1.66E-15 3.90 pfe prim 1426 7.99E-15 6.17 1.87E-15 4.08 real g77 1305 9.48E-13 13.06 2.86E-14 8.01 normal 1471 1.06E-12 13.22 3.81E-14 8.42 kahan 1730 9.33E-12 16.36 2.09E-13 10.88 pfe prim 1432 5.33E-13 12.23 2.14E-14 7.59 imaginary g77 1307 3.38E-13 11.57 1.43E-14 7.01 normal 1473 3.60E-13 11.66 1.53E-14 7.10 kahan 1726 7.62E-12 16.07 1.71E-13 10.59 pfe prim 1428 7.63E-12 16.07 1.71E-13 10.59 g77 Z W [Z^W - [1/Z]^[-W]]/|Z^W| 1.318E+00 + i 4.727E+00 8.132E-01 + i 1.655E+00 1.306E-16 - i 3.919E-16 6.852E+00 + i 6.492E+00 1.478E+00 + i 4.707E+00 0.000E+00 + i 0.000E+00 8.341E+00 + i 2.586E+00 3.268E+00 + i 8.480E+00 -9.174E-16 + i 3.593E-15 9.978E+00 + i 7.198E+00 9.748E+00 + i 8.531E+00 0.000E+00 + i 0.000E+00 6.373E+00 + i 6.664E+00 2.977E+00 + i 2.112E+00 -6.304E-16 + i 6.304E-16 normal Z W [Z^W - [1/Z]^[-W]]/|Z^W| 1.318E+00 + i 4.727E+00 8.132E-01 + i 1.655E+00 -5.226E-16 - i 9.145E-16 6.852E+00 + i 6.492E+00 1.478E+00 + i 4.707E+00 -1.286E-15 - i 1.286E-15 8.341E+00 + i 2.586E+00 3.268E+00 + i 8.480E+00 -0.000E+00 + i 0.000E+00 9.978E+00 + i 7.198E+00 9.748E+00 + i 8.531E+00 -0.000E+00 + i 0.000E+00 6.373E+00 + i 6.664E+00 2.977E+00 + i 2.112E+00 -0.000E+00 + i 0.000E+00 kahan Z W [Z^W - [1/Z]^[-W]]/|Z^W| 1.318E+00 + i 4.727E+00 8.132E-01 + i 1.655E+00 -0.000E+00 - i 0.000E+00 6.852E+00 + i 6.492E+00 1.478E+00 + i 4.707E+00 -0.000E+00 - i 0.000E+00 8.341E+00 + i 2.586E+00 3.268E+00 + i 8.480E+00 -0.000E+00 - i 0.000E+00 9.978E+00 + i 7.198E+00 9.748E+00 + i 8.531E+00 -0.000E+00 - i 0.000E+00 6.373E+00 + i 6.664E+00 2.977E+00 + i 2.112E+00 -0.000E+00 - i 0.000E+00 pfe prim Z W [Z^W - [1/Z]^[-W]]/|Z^W| 1.318E+00 + i 4.727E+00 8.132E-01 + i 1.655E+00 1.306E-16 - i 3.919E-16 6.852E+00 + i 6.492E+00 1.478E+00 + i 4.707E+00 -0.000E+00 - i 0.000E+00 8.341E+00 + i 2.586E+00 3.268E+00 + i 8.480E+00 -0.000E+00 - i 0.000E+00 9.978E+00 + i 7.198E+00 9.748E+00 + i 8.531E+00 -0.000E+00 - i 0.000E+00 6.373E+00 + i 6.664E+00 2.977E+00 + i 2.112E+00 -0.000E+00 - i 0.000E+00 Test near an extreme argument. The second line uses the binomial expansion. This should not, but may trigger an error message: g77 [BETA + i*BETA*XMIN]^[MAXEXP-1+i0] = 8.988466E+307 + i 2.046000E+03 BETA^[MAXEXP-1] * [1 + i*[MAXEXP-1]*XMIN] = 8.988466E+307 + i 2.046000E+03 difference = 2.814135E+294 + i 6.411938E-11 normal [BETA + i*BETA*XMIN]^[MAXEXP-1+i0] = 8.988466E+307 + i 0.000000E+00 BETA^[MAXEXP-1] * [1 + i*[MAXEXP-1]*XMIN] = 8.988466E+307 + i 2.046000E+03 difference = 2.814135E+294 - i 2.046000E+03 kahan [BETA + i*BETA*XMIN]^[MAXEXP-1+i0] = 8.988466E+307 + i 0.000000E+00 BETA^[MAXEXP-1] * [1 + i*[MAXEXP-1]*XMIN] = 8.988466E+307 + i 2.046000E+03 difference = 2.814135E+294 - i 2.046000E+03 pfe prim [BETA + i*BETA*XMIN]^[MAXEXP-1+i0] = 8.988466E+307 + i 2.046000E+03 BETA^[MAXEXP-1] * [1 + i*[MAXEXP-1]*XMIN] = 8.988466E+307 + i 2.046000E+03 difference = 2.814135E+294 + i 6.411938E-11 Test of error returns: [0+i0]^[0+i0] = g77 0.000E+00 + i 0.000E+00 normal NAN + i NAN kahan NAN + i NAN pfe prim NAN + i NAN