home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / ibm / pc / hardware / 22194 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  58.5 KB

  1. Path: sparky!uunet!kithrup!stanford.edu!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!uka!uka!news
  2. From: S_JUFFA@iravcl.ira.uka.de (|S| Norbert Juffa)
  3. Newsgroups: comp.sys.ibm.pc.hardware
  4. Subject: What you always wnated to know about math copros 3/4
  5. Date: 19 Aug 1992 15:17:00 GMT
  6. Organization: University of Karlsruhe (FRG) - Informatik Rechnerabt.
  7. Lines: 974
  8. Distribution: world
  9. Message-ID: <16tolcINNctu@iraul1.ira.uka.de>
  10. NNTP-Posting-Host: irav1.ira.uka.de
  11. X-News-Reader: VMS NEWS 1.23
  12.  
  13.  
  14.          HW configuration for test of 387 coprocessors and Intel RapidCAD:
  15.          System A: Motherboard with Forex chip set, 128 kB CPU Cache, 8 MB RAM
  16.  
  17.          HW configuration for test of 486 FPU (extra fan for 40 MHz operation):
  18.          System B: Motherboard with SIS chip set, 256 kB CPU Cache, 8 MB RAM
  19.  
  20.          ## EM87 V1.2 by Ron Kimball is a public domain coprocessor emulator
  21.             that loads as a TSR. It uses INT 7 traps emitted by 80286, 80386
  22.             systems with no coprocessor upon encountering coprocessor
  23.             instructions to catch coprocessor instructions and emulate them.
  24.             Whetstone and Savage benchmarks for this test were compiled
  25.             with the original TP 6.0 library, as EM87 chokes on the 387
  26.             specific FSIN and FCOS instructions used in my own library if
  27.             a 387 is detected. Obviously EM87 identifies itself as a 387,
  28.             but has no support for 387 specific instructions.
  29.          $$ Franke387 is a commercial 387 emulator that is also available in
  30.             a shareware version. For this test, shareware version V2.4 was
  31.             used. Franke387 unlike many other emulators supports all 387
  32.             instructions. It is loaded as a device driver and uses INT 7
  33.             to trap coprocessor instructions.
  34.          %% These benchmarks were run using the built-in coprocessor emulators
  35.             of the TP 6.0 and the MS FORTRAN 5.0 run-time libraries.
  36.          ?? The 3C87 specific F4X4 instruction was used in the vector trans-
  37.             formation benchmark.
  38.          ++ Older motherboard with no chip set (discrete logic), no CPU cache,
  39.             16 MB RAM
  40.          && System A, CPU cache disabled via extended set-up, turbo-switch
  41.             set to half speed (that is, 20 MHz)
  42.          !! 80386 @ 20 MHz / Intel 80287 @ 5 MHz, no CPU cache, 4 MB RAM
  43.             due to the fast CPU used here, performance figures are somewhat
  44.             higher than can be expected for a 80286/287 combination, except
  45.             for the PEAKFLOP benchmark, which is basically coprocessor limited
  46.          ** 8086/8087 system with 640 kB RAM
  47.  
  48.  
  49.          Since neither a Weitek coprocessor nor a compiler that generates
  50.          code for the Weitek chips were available, performance data for
  51.          the Weitek Abacus are given here according to [31,32] and scaled to
  52.          show performance of a 33 MHz system. The benchmarks were compiled
  53.          using highly optimizing 32-bit compilers.
  54.  
  55.                               Single Prec.     Double Prec.    Double Prec.
  56.  
  57.                               3167    4167     3167    4167      387    486
  58.  
  59.          Linpack MFLOPS        1.8     5.0      0.8     3.2      0.4    1.6
  60.          Whetstone kWhet/sec  7470   22700     4900   14000     3290  12300
  61.  
  62.          Note that for the Intel coprocessors, running programs in single
  63.          vs. double precision doesn't provide much of an performance advantage
  64.          since all internal calculations are always done in extended precision.
  65.          Using Weitek coprocessors however, performance nearly doubles when
  66.          switching fron double to single precision. For double precision
  67.          calculations using only basic arithmetic, the Weitek Abacus can
  68.          provide performance at twice the level of the respective Intel
  69.          coprocessor (387/486) clocked at the same speed at most.
  70.  
  71.  
  72.          Speed of various coprocessor instructions measured in clock cycles
  73.          as measured with my program 87TIMES. Error is +/- one clock cycle,
  74.          except for the Intel 80287. Times for the 80287 were determined on
  75.          a system with a 20 MHz 80386 and a 5 MHz Intel 80287. Therefore,
  76.          times may differ from a genuine 80286/287 system, especially for
  77.          those instructions that access an operand in memory. Since the
  78.          times are stated as the number of coprocessor clock cycles used,
  79.          the faster 386 which can execute four clock cycles where the 80287
  80.          executes one clock cycle may decrease memory access times as seen
  81.          by the coprocessor.
  82.  
  83.  
  84.                            Intel  Intel  Cyrix Cyrix ULSI  IIT  Intel Intel
  85.                            i486 RapidCAD 387+  83D87 83C87 3C87 387DX 80387
  86.  
  87.                     FLD1 |   5      7    17    17    17    22    27    35
  88.                     FLDZ |   5      7    17    17    17    22    22    29
  89.                    FLDPI |   8      9    17    17    17    22    37    45
  90.                   FLDLG2 |   8      9    17    17    17    22    37    44
  91.                   FLDL2T |   8      9    17    17    17    22    37    44
  92.                   FLDL2E |   8      9    17    17    17    22    37    44
  93.                   FLDLN2 |   8      9    17    17    17    22    37    45
  94.                FLD ST(0) |   5      7    17    17    17    22    17    24
  95.                FST ST(1) |   4      7    17    17    17    17    17    24
  96.               FSTP ST(0) |   5      7    17    17    17    18    23    25
  97.               FSTP ST(1) |   5      7    17    17    17    17    23    25
  98.                FLD ST(1) |   5      7    17    17    17    22    17    25
  99.               FXCH ST(1) |   5      7    17    17    17    22    22    25
  100.              FILD [Word] |  13     16    35    36    41    46    46    65
  101.             FILD [DWord] |  12     17    30    30    37    37    40    51
  102.             FILD [QWord] |  13     20    40    40    47    47    45    66
  103.              FLD [DWord] |   7     13    30    36    32    37    25    35
  104.              FLD [QWord] |   7     15    40    44    42    47    35    45
  105.              FLD [TByte] |  10     19    52    52    52    57    57    61
  106.             FBLD [TByte] |  83     91    84    66   145   205    70   278
  107.              FIST [Word] |  32     34    43    42    45    54    72    92
  108.             FIST [DWord] |  33     35    48    44    48    57    74    91
  109.              FST [DWord] |  11     14    44    42    49    41    46    47
  110.              FST [QWord] |  16     18    56    54    60    53    58    60
  111.             FISTP [Word] |  32     35    43    42    45    49    73    93
  112.            FISTP [DWord] |  34     37    48    44    48    52    75    88
  113.            FISTP [QWord] |  35     37    57    53    61    63    86    96
  114.             FSTP [DWord] |  12     13    44    42    48    37    46    42
  115.             FSTP [QWord] |  16     17    56    55    60    50    59    57
  116.             FSTP [TByte] |  14     16    59    58    58    56    67    70
  117.            FBSTP [TByte] | 171    175   101    98   126   216   147   535
  118.                    FINIT |  18     35    18    18    18    18    19    25
  119.                    FCLEX |   8     24    18    18    18    18    19    25
  120.                     FCHS |   8     11    17    17    17    17    31    35
  121.                     FABS |   6      8    17    17    17    17    28    31
  122.                     FXAM |  13     15    17    17    17    17    37    40
  123.                     FTST |   5      7    22    17    22    22    32    35
  124.                   FSTENV |  68     85   127   127   135   127   162   169
  125.                   FLDENV |  45     62   109   109   123   109   122   132
  126.                    FSAVE | 160    172   359   359   366   377   467   504
  127.                   FRSTOR | 131    206   361   361   369   367   424   453
  128.              FSTSW [mem] |   4      7    16    16    17    16    17    22
  129.                 FSTSW AX |   4      7    14    14    14    14    14    17
  130.              FSTCW [mem] |   4      7    16    16    16    16    16    22
  131.              FLDCW [mem] |   5     14    28    28    29    29    29    34
  132.            FADD ST,ST(0) |   8      9    22    17    17    22    27    30
  133.            FADD ST,ST(1) |   9     10    22    17    17    22    22    34
  134.            FADD ST(1),ST |  10     10    22    17    17    22    23    35
  135.           FADDP ST(1),ST |  11     11    22    17    17    22    23    34
  136.             FADD [DWord] |   9     14    30    30    33    32    31    42
  137.             FADD [QWord] |   9     16    40    40    43    42    41    51
  138.             FIADD [Word] |  20     21    36    36    43    43    49    77
  139.            FIADD [DWord] |  20     25    30    30    38    38    43    65
  140.            FSUB ST(1),ST |  10     10    22    17    17    22    23    35
  141.           FSUBR ST(1),ST |   9     10    22    17    20    25    27    35
  142.          FSUBRP ST(1),ST |  10     10    22    17    17    22    23    35
  143.             FSUB [DWord] |  11     14    30    30    32    32    30    41
  144.             FSUB [QWord] |  11     16    40    40    42    43    40    51
  145.             FISUB [Word] |  21     21    36    36    44    43    56    77
  146.            FISUB [DWord] |  21     25    30    30    39    38    43    65
  147.            FMUL ST,ST(1) |  16     17    22    22    22    27    38    56
  148.            FMUL ST(1),ST |  16     17    22    22    22    27    40    60
  149.           FMULP ST(1),ST |  16     17    22    22    22    27    38    59
  150.             FIMUL [Word] |  22     23    36    36    50    43    50    77
  151.            FIMUL [DWord] |  22     25    36    36    45    38    46    73
  152.             FMUL [DWord] |  11     14    36    36    32    38    31    48
  153.             FMUL [QWord] |  14     16    46    46    42    48    41    72
  154.            FDIV ST,ST(0) |  73     74    38    23    52    57    92    95
  155.            FDIV ST,ST(1) |  73     74    42    36    52    57    78    95
  156.            FDIV ST(1),ST |  73     74    42    36    52    57    78    99
  157.           FDIVR ST(1),ST |  73     74    42    36    53    57    77   100
  158.          FDIVRP ST(1),ST |  73     74    42    36    52    57    78   101
  159.             FIDIV [Word] |  84     85    61    54    79    73   105   144
  160.            FIDIV [DWord] |  84     85    54    47    74    68   101   129
  161.             FDIV [DWord] |  73     74    54    48    63    62    78   100
  162.             FDIV [QWord] |  73     74    64    57    72    72    79   113
  163.              FSQRT (0.0) |  26     28    17    17    17    22    27    35
  164.              FSQRT (1.0) |  83     84    72    36    87    57   112   128
  165.              FSQRT (L2T) |  86     87    72    36    87    57   102   133
  166.            FXTRACT (L2T) |  17     17    22    17    32    76    56    68
  167.            FSCALE (PI,5) |  30     31    22    36    47    77    57    80
  168.             FRNDINT (PI) |  31     31    27    19    32    27    47    74
  169.            FPREM (99,PI) |  58     60   102    52    57    52    77   100
  170.            FPREM1(99,PI) |  90     91   102    57    62    52   102   119
  171.                     FCOM |   5      7    17    17    27    17    27    34
  172.                    FCOMP |   6      7    17    17    27    17    28    35
  173.                   FCOMPP |   7      8    17    17    27    22    28    34
  174.             FICOM [Word] |  16     20    36    36    49    37    61    77
  175.            FICOM [DWord] |  18     25    30    30    44    32    48    61
  176.             FCOM [DWord] |   7     14    30    30    33    32    31    35
  177.             FCOM [QWord] |   7     15    40    40    43    42    41    51
  178.               FSIN (0.0) |  25     27    97    17    17    22    37    45
  179.               FSIN (1.0) | 310    314   162   116   492   222   512   593
  180.                FSIN (PI) |  88     90   187   121    67   217   132   155
  181.               FSIN (LG2) | 284    288    84    73   445   184   434   505
  182.               FSIN (L2T) | 299    303   177   121   472   217   452   533
  183.               FCOS (0.0) |  25     27   157    17    22    22    37    44
  184.               FCOS (1.0) | 302    306   107    87   487   212   457   540
  185.                FCOS (PI) |  89     92   257   151    62   222   197   230
  186.               FCOS (LG2) | 300    304   152   106   452   192   502   584
  187.               FCOS (L2T) | 307    311   242   156   467   222   507   598
  188.            FSINCOS (0.0) |  26     29    17    17    22    31    41    54
  189.            FSINCOS (1.0) | 353    357   172   126   492   416   536   637
  190.             FSINCOS (PI) | 105    107   262   161    67   421   226   273
  191.            FSINCOS (LG2) | 340    344   157   116   457   361   531   628
  192.            FSINCOS (L2T) | 347    351   247   166   472   421   536   643
  193.              FPTAN (0.0) |  26     28    17    17    22    31    36    43
  194.              FPTAN (1.0) | 267    269   147   121   537   306   322   392
  195.               FPTAN (PI) | 145    146   227   136   112   306   167   212
  196.              FPTAN (LG2) | 244    246   132    91   502   276   297   363
  197.              FPTAN (L2T) | 247    249   217   136   517   306   297   363
  198.             FPATAN (0.0) |  39     41    27    22    22    27    97    92
  199.             FPATAN (1.0) | 294    298   157   121   372   602   358   433
  200.              FPATAN (PI) | 304    307   192   143   357   422   378   468
  201.             FPATAN (LG2) | 289    293   157   126   362   382   373   447
  202.             FPATAN (L2T) | 304    307   192   141   362   422   373   463
  203.              F2XM1 (0.0) |  26     28    17    17    17    22    37    38
  204.              F2XM1 (LN2) | 209    212   122    86   392   287   297   348
  205.              F2XM1 (LG2) | 204    207   107    76   377   287   292   340
  206.              FYL2X (1.0) |  60     60    42    36    72    92   112   127
  207.               FYL2X (PI) | 294    297   162   111   452   357   393   497
  208.              FYL2X (LG2) | 311    314   162   106   457   337   408   512
  209.              FYL2X (L2T) | 293    296   162   111   437   357   393   496
  210.            FYL2XP1 (LG2) | 334    337   167   101   462   282   433   533
  211.  
  212.  
  213.  
  214.                                          80386 +   80386 +  80386 +
  215.                             Intel Intel  Franke387 TP 6.0   EM87
  216.                             8087  80287  Emulator  Emulator Emulator
  217.  
  218.               FSTP ST(0) |   26     54     507       358      2115
  219.                     FLD1 |   26     55     481       422      1626
  220.                     FLDZ |   21     53     480       416      1646
  221.                    FLDPI |   26     55     486       443      1626
  222.                   FLDLG2 |   26     56     486       423      1626
  223.                   FLDL2T |   26     55     486       440      1626
  224.                   FLDL2E |   26     53     486       423      1626
  225.                   FLDLN2 |   26     55     486       441      1626
  226.                FLD ST(0) |   31     55     493       362      1851
  227.                FST ST(1) |   26     54     489       355      1931
  228.               FSTP ST(1) |   21     55     507       356      2116
  229.                FLD ST(1) |   26     55     493       362      1852
  230.               FXCH ST(1) |   21     57     497       486      2187
  231.              FILD [Word] |   58     90     667       712      2259
  232.             FILD [DWord] |   64     74     608       812      2164
  233.             FILD [QWord] |   74     93     652       707      2971
  234.              FLD [DWord] |   49     44     633       473      2077
  235.              FLD [QWord] |   54     57     641       524      2336
  236.              FLD [TByte] |   59     45     607       492      2063
  237.             FBLD [TByte] |  309    310    2019      1512     17827
  238.              FIST [Word] |   79     72     854       766      2418
  239.             FIST [DWord] |   84     80     865       518      2325
  240.              FST [DWord] |   89     85     686       441      2200
  241.              FST [QWord] |   99     92     703       516      2481
  242.             FISTP [Word] |   79     80     864       794      2620
  243.            FISTP [DWord] |   79     81     879       541      2523
  244.            FISTP [QWord] |   88     75     904       916      3226
  245.             FSTP [DWord] |   89     75     713       467      2400
  246.             FSTP [QWord] |   93     72     732       538      2678
  247.             FSTP [TByte] |   49     21     685       467      2124
  248.            FBSTP [TByte] |  528    472    3305      1555     27013
  249.                    FINIT |   11     10     742       641      1369
  250.                    FCLEX |   11     10     440       323       912
  251.                     FCHS |   21     54     460       354      1744
  252.                     FABS |   21     54     456       349      1738
  253.                     FXAM |   21     54     481       380      1551
  254.                     FTST |   51     75     585       386      2721
  255.                   FSTENV |   54     57     928       519      2104
  256.                   FLDENV |   48     50    1125       450      1631
  257.                    FSAVE |  214    244    1949       976      2749
  258.                   FRSTOR |  209    227    2182       657      2225
  259.              FSTSW [mem] |   28     10     516       401      1189
  260.                 FSTSW AX |  N/A     55     451       N/A       N/A
  261.              FSTCW [mem] |   28     10     506       359      1167
  262.              FLDCW [mem] |   19     47     524       437      1584
  263.            FADD ST,ST(0) |   86    128     643       706      2805
  264.            FADD ST,ST(1) |   85    116     707       808      3093
  265.            FADD ST(1),ST |   92    131     664       812      3146
  266.           FADDP ST(1),ST |   92    129     704       799      3143
  267.             FADD [DWord] |  105    122     874       969      3139
  268.             FADD [QWord] |  115    122     888      1021      3396
  269.             FIADD [Word] |  115    122     940      1211      3330
  270.            FIADD [DWord] |  125    122     882      1297      3215
  271.            FSUB ST(1),ST |   88    130     738       817      3156
  272.           FSUBR ST(1),ST |   96    132     740       868      3004
  273.          FSUBRP ST(1),ST |   99    132     733       805      3301
  274.             FSUB [DWord] |  119    122     918      1018      3127
  275.             FSUB [QWord] |  129    123     932      1070      3632
  276.             FISUB [Word] |  115    123     977      1081      3802
  277.            FISUB [DWord] |  125    125     940       980      4161
  278.            FMUL ST,ST(1) |  145    151     810      1368      3924
  279.            FMUL ST(1),ST |  145    151     817      1377      3962
  280.           FMULP ST(1),ST |  148    168     840      1365      4164
  281.             FIMUL [Word] |  132    151    1039      1517      4039
  282.            FIMUL [DWord] |  141    151     980      1643      3976
  283.             FMUL [DWord] |  125    123     948      1480      3445
  284.             FMUL [QWord] |  175    192     991      1602      4416
  285.            FDIV ST,ST(0) |  201    207     726      1536      9789
  286.            FDIV ST,ST(1) |  203    218     808      1658     10332
  287.            FDIV ST(1),ST |  207    214     825      1655     10342
  288.           FDIVR ST(1),ST |  201    206     819      1806     10213
  289.          FDIVRP ST(1),ST |  201    205     845      1803     10409
  290.             FIDIV [Word] |  237    227     980      1779     11225
  291.            FIDIV [DWord] |  246    227     944      1680     11572
  292.             FDIV [DWord] |  229    226     893      1722     10577
  293.             FDIV [QWord] |  236    227     993      1777     10829
  294.              FSQRT (0.0) |   21     57     512       382      1755
  295.              FSQRT (1.0) |  186    206    1106      2504     37836
  296.              FSQRT (L2T) |  186    207    1398      2467     37925
  297.            FXTRACT (L2T) |   51     56     726       571      3326
  298.            FSCALE (PI,5) |   41     56     817       443      3194
  299.             FRNDINT (PI) |   51     58     808       800      7092
  300.            FPREM (99,PI) |   81    131    1696       941      4098
  301.            FPREM1(99,PI) |  N/A    N/A    1625       N/A       N/A
  302.                     FCOM |   56     75     582       483      2799
  303.                    FCOMP |   61     92     616       485      2983
  304.                   FCOMPP |   61     90     661       476      3198
  305.             FICOM [Word] |   79     77     808       861      3654
  306.            FICOM [DWord] |   89     77     750       964      3684
  307.             FCOM [DWord] |   74     75     741       625      3643
  308.             FCOM [QWord] |   74     76     754       667      3771
  309.               FSIN (0.0) |  N/A    N/A     639       N/A       N/A
  310.               FSIN (1.0) |  N/A    N/A    4640       N/A       N/A
  311.                FSIN (PI) |  N/A    N/A    2488       N/A       N/A
  312.               FSIN (LG2) |  N/A    N/A    3911       N/A       N/A
  313.               FSIN (L2T) |  N/A    N/A    3767       N/A       N/A
  314.               FCOS (0.0) |  N/A    N/A     740       N/A       N/A
  315.               FCOS (1.0) |  N/A    N/A    4777       N/A       N/A
  316.                FCOS (PI) |  N/A    N/A    2557       N/A       N/A
  317.               FCOS (LG2) |  N/A    N/A    4176       N/A       N/A
  318.               FCOS (L2T) |  N/A    N/A    3905       N/A       N/A
  319.            FSINCOS (0.0) |  N/A    N/A     714       N/A       N/A
  320.            FSINCOS (1.0) |  N/A    N/A    6049       N/A       N/A
  321.             FSINCOS (PI) |  N/A    N/A    4091       N/A       N/A
  322.            FSINCOS (LG2) |  N/A    N/A    5640       N/A       N/A
  323.            FSINCOS (L2T) |  N/A    N/A    5405       N/A       N/A
  324.              FPTAN (0.0) |   41     58     752      8381      2324
  325.              FPTAN (1.0) |  581    582    6366     10817     29824
  326.               FPTAN (PI) |  606    587    4388     12410      2300
  327.              FPTAN (LG2) |  516    513    5939     12502     26770
  328.              FPTAN (L2T) |  576    586    5723     12483      2301
  329.             FPATAN (0.0) |   41     55     616      1208     10578
  330.             FPATAN (1.0) |  736    736    1426     13446     34208
  331.              FPATAN (PI) |  206    207   12835     13305     46903
  332.             FPATAN (LG2) |  756    736   12490     13319     41312
  333.             FPATAN (L2T) |  206    204   12922     13364     50149
  334.              F2XM1 (0.0) |   16     56     563       723      1722
  335.              F2XM1 (LN2) |  631    624    4178     11070     33823
  336.              F2XM1 (LG2) |  611    585    4798     11116     32163
  337.              FYL2X (1.0) |   56     57     961      1214      4327
  338.               FYL2X (PI) |  946    961    8987     12858     40148
  339.              FYL2X (LG2) | 1081   1038    8933     12748     46821
  340.              FYL2X (L2T) |  926    886    8982     12712     38986
  341.            FYL2XP1 (LG2) | 1026   1037   10485     11867     44708
  342.  
  343.          The Weitek 3167 and 4167 processors only implement the basic
  344.          arithmetic functions (add, subtract, multiply, divide, square
  345.          root) in hardware. Transcendental functions are implemented
  346.          by means of a software library supplied by Weitek that uses
  347.          the Weitek hardware to approximate the transcendental functions
  348.          with polynomial and rational approximations. The clock cycle
  349.          timings for the transcendental functions are average values,
  350.          since execution time differs with the value of argument. The
  351.          speed of transcendental functions for the 4167 is estimated
  352.          based on the numbers in [31,33], from which this timing
  353.          information has been extracted.
  354.  
  355.  
  356.          Execution time for floating-point operations in clock cycles on
  357.          Weitek coprocessors
  358.  
  359.                   Single Precision         Double Precision
  360.  
  361.                   3167       4167          3167        4167
  362.  
  363.          ABS         3          2             3           2
  364.          NEG         6          2             6           2
  365.          ADD         6          2             6           2
  366.          SUB         6          2             6           2
  367.          SUBR        6          2             6           2
  368.          MUL         6          2            10           3
  369.          DIVR       38         17            66          31
  370.          SQRT       60         17           118          31
  371.          SIN       146        ~50           292        ~100
  372.          COS       140        ~50           285        ~100
  373.          TAN       188        ~60           340        ~110
  374.          EXP       179        ~60           401        ~130
  375.          LOG       171        ~60           365        ~120
  376.          F->ASCII 1000        N/A          1700         N/A  //
  377.          ASCII->F 1100        N/A          1800         N/A  //
  378.  
  379.          // rough average of the timings given for different numeric
  380.             formats by Weitek. Note that these conversions routines
  381.             do much more work than the FBLD and FBSTP instructions
  382.             provided by the 80x87 coprocessors. FBLD and FBSTP are
  383.             useful for conversion routines but quite a bit of additional
  384.             code is need for this purpose.
  385.  
  386.  
  387.          Accuracy
  388.  
  389.          The IEEE-754 Standard for Binary Floating-Point Arithmetic [10,11]
  390.          is fully implemented by Intel's 387 coprocessor [17]. Among other
  391.          things, this means that the add, subtract, multiply, divide,
  392.          remainder, and square root operations always deliver the 'exact'
  393.          result. By exact it is meant that the coprocessor always delivers
  394.          the machine number closest to the real result, which may not
  395.          be representable exactly in the available numeric format. The
  396.          80387 implements the single, double, and double extended formats
  397.          as specified in the standard as well as all functions required
  398.          by it [17]. Note that earlier Intel coprocessors (the 8087 and
  399.          the 80287) comply with a draft version of the standard that differs
  400.          from the final version. These chips came out before the IEEE-754
  401.          standard was finally accepted in 1985. As in the 80387, the basic
  402.          arithmetic in the 8087 and the 80287 is exact in the sense that
  403.          the computed result is always the machine number closest to the
  404.          real result. However, there are some differences regarding certain
  405.          operands like infinities and some operation like the remainder are
  406.          defined differently. Some instructions have been added in the 80387,
  407.          most notably the FSIN and FCOS operations. The argument range for
  408.          some transcendental function has been extended [17]. Note that the
  409.          IEEE-754 standard says nothing about the quality of the implementation
  410.          of transcendental functions like sin, cos, tan, arctan, log. Intel
  411.          uses a modified CORDIC [18,19] technique to compute the transcendental
  412.          functions. Intel claims that maximum error in the 8087, 80287, and
  413.          80387 for all transcendental functions does not exceeed two bits
  414.          in the mantissa of the double extended format, which features 64
  415.          mantissa bits for an accuracy of approximately 19 decimal places
  416.          [22,23]. This claim has been independently verified by a competing
  417.          vendor [13]. This means that at least 62 of the 64 mantissa bits
  418.          in a transcendental function result are correct.
  419.  
  420.          The Weitek Abacus 3167 and 4167 are 'mostly compatible' with
  421.          IEEE-754 [31,32,33]. It supports the single precision and double
  422.          precision numeric formats formats described in the standard as
  423.          well as the four rounding modes required by it. However, due to
  424.          the need for extremely high speed operation, some of the finer
  425.          points of IEEE-754 have not been implemented. One of the most
  426.          notable omissions is the missing support for denormal numbers.
  427.          Denormals are always flushed to zero.
  428.  
  429.          The 387 clone makers claim 100% compatibility with Intel's 80387.
  430.          So one would expect the same accuracy from their chips. For example,
  431.          on the packaging of the IIT 3C87 it says that ".. the requirements
  432.          of ANSI/IEEE standards are fulfilled and exceeded". Cyrix states
  433.          that their 83D87 complies fully with the IEEE-754 standard [12].
  434.          Cyrix delivers with their copocessors some diagnostic software.
  435.          This includes the program IEEETEST which is based on the IEEE test
  436.          vectors from the Ph.D. thesis of Jerome T. Coonen [9]. A test using
  437.          the IEEE test vectors has also been included into the RUNDIAG
  438.          program on the Intel RapidCAD diagnostic disk. Rather than performing
  439.          random tests, the test vectors check specific cases that may
  440.          be hard to get right. Each test vector specifies the operation
  441.          to be performed, the operands, precision and rounding mode to be
  442.          used, and the result (including flags set) to be expected according
  443.          to IEEE-754. I ran IEEETEST on all the available coprocessors/ FPUs.
  444.          The Intel 486, Intel RapidCAD, Intel 387, Intel 387DX, Cyrix 83D87,
  445.          and the Cyrix 387+ passed with no errors. The ULSI 83C87 showed
  446.          some minor flaws in the FCOM, FDIV, FMUL, and FSCALE operations,
  447.          getting flag errors in about 1% of the tested cases, but no
  448.          computational errors. However, for the IIT 3C87, the IEEETEST
  449.          program showed flag *and* some computational errors (that is, wrong
  450.          results) for all tested operations except FXTRACT and FCHS. The Intel
  451.          80287 shows numerous errors, but this it not surprising, since the
  452.          80287 does not comply with IEEE-754 but with an earlier draft of that
  453.          standard, so it does some thing differently than required by the final
  454.          version of the standard.
  455.  
  456.          Although IEEETEST is written in Turbo Pascal, the coprocessor
  457.          emulator in the TP 6.0 library could not be tested since IEEETEST
  458.          was compiled with the $E- switch excluding the emulator from
  459.          program code. The public domain emulator EM87 could be tested, but
  460.          hung in the last test which checks the implementation of the
  461.          remainder operation. This is probably caused by some bug in the
  462.          emulation of the FPREM instruction tested in this test. It is
  463.          interesting to note how the error profile of EM87 matches exactly
  464.          that of the Intel 80287, so it can be assumed that EM87 is a very
  465.          good emulation of the 80287. The Franke387 V2.4 emulator hung in
  466.          the division test quite early in IEEETEST. The tests performed
  467.          up to the division test reported several errors.
  468.  
  469.  
  470.  
  471.          Explanatory text printed at the start of the IEEETEST program:
  472.  
  473.          JT Coonen's 1984 UC Berkeley Ph.D. thesis centers around his
  474.          activities as a member of the floating-point working group that
  475.          defined the IEEE 754-1985 Standard for Binary Floating-Point
  476.          Arithmetic. Appendix C of his thesis presents FPTEST, a Pascal
  477.          program written by J Thomas and JT Coonen. IEEETEST is a port of
  478.          FPTEST and runs on PCs whose math coprocessor accepts 80387
  479.          compatible floating-point instructions.
  480.  
  481.          IEEETEST reads test vectors from the file TESTVECS and compares
  482.          the answer returned by the math coprocessor with the answer listed
  483.          in the test vector. If these answers differ an 'F' is displayed,
  484.          otherwise a '.'is displayed. Answers can differ due to two types
  485.          of failures: numeric failures or flag failures. Numeric failures
  486.          occur when the computed answer has the wrong value. Flag failures
  487.          occur when the status (invalid operation, divide by zero, underflow,
  488.          overflow, inexact) is incorrectly identified.
  489.  
  490.          TESTVECS is the concatenation of unmodified versions of all the
  491.          test vectors distributed by UC Berkeley. The test data base is
  492.          copyrighted by UC Berkeley (1985) and is being distributed with
  493.          their permission. FPTEST and the test data base can be obtained
  494.          by asking for 'IEEE-754 Test Vector' from UC Berkeley, Electrical
  495.          Engineering and Computer Science, Industrial Liaison Program,
  496.          479 Corey Hall, Berkeley, CA, 94720 (415)643-6687.
  497.  
  498.          The initial version of this test data base for the proposed IEEE
  499.          754 binary floating-point standard (draft 8.0) was developed for
  500.          Zilog, Inc. and was donated to the floating-point working group
  501.          for dissemination. Errors in or additions to the distributed data
  502.          base should be reported to the agency of distribution, with copies
  503.          to Zilog, Inc., 1315 Dell Avenue, Campbell, CA, 95008.
  504.  
  505.  
  506.          IEEETEST output for Intel 80387, Intel 387DX, Intel 486,
  507.                              Cyrix 83D87, Cyrix 387+, RapidCAD
  508.  
  509.          IEEE-754 Test Vector  Precisions: S=Single D=Double E=Double Extended
  510.                                |     TESTS     | numeric TYPE OF FAILURE flag
  511.                 Operation Code | Passed Failed |    S    D    E |   S    D    E
  512.          ----------------------------------------------------------------------
  513.            Absolute Value    A |    216      0 |    0    0    0 |   0    0    0
  514.                  Addition    + |   3528      0 |    0    0    0 |   0    0    0
  515.                Comparison    C |   4320      0 |    0    0    0 |   0    0    0
  516.                 Copy Sign    @ |   1488      0 |    0    0    0 |   0    0    0
  517.                  Division    / |   4311      0 |    0    0    0 |   0    0    0
  518.             Fraction Part    F |    624      0 |    0    0    0 |   0    0    0
  519.                      Logb    L |    960      0 |    0    0    0 |   0    0    0
  520.            Multiplication    * |   3978      0 |    0    0    0 |   0    0    0
  521.                  Negation    - |    216      0 |    0    0    0 |   0    0    0
  522.                Next After    N |   2832      0 |    0    0    0 |   0    0    0
  523.          Round to Integer    I |    558      0 |    0    0    0 |   0    0    0
  524.                     Scalb    S |    948      0 |    0    0    0 |   0    0    0
  525.               Square Root    V |    744      0 |    0    0    0 |   0    0    0
  526.               Subtraction    - |   3528      0 |    0    0    0 |   0    0    0
  527.                 Remainder    % |   2984      0 |    0    0    0 |   0    0    0
  528.                         Totals |  31235      0 |
  529.  
  530.  
  531.          IEEETEST output for ULSI 83C87
  532.  
  533.          IEEE-754 Test Vector  Precisions: S=Single D=Double E=Double Extended
  534.                                |     TESTS     | numeric TYPE OF FAILURE flag
  535.                 Operation Code | Passed Failed |    S    D    E |   S    D    E
  536.          ----------------------------------------------------------------------
  537.            Absolute Value    A |    216      0 |    0    0    0 |   0    0    0
  538.                  Addition    + |   3528      0 |    0    0    0 |   0    0    0
  539.                Comparison    C |   4312      8 |    0    0    0 |   0    0    8
  540.                 Copy Sign    @ |   1488      0 |    0    0    0 |   0    0    0
  541.                  Division    / |   4250     61 |    0    0    0 |  28   28    5
  542.             Fraction Part    F |    624      0 |    0    0    0 |   0    0    0
  543.                      Logb    L |    960      0 |    0    0    0 |   0    0    0
  544.            Multiplication    * |   3936     42 |    0    0    0 |  19   19    4
  545.                  Negation    - |    216      0 |    0    0    0 |   0    0    0
  546.                Next After    N |   2828      4 |    0    0    0 |   0    0    4
  547.          Round to Integer    I |    558      0 |    0    0    0 |   0    0    0
  548.                     Scalb    S |    930     18 |    0    0    0 |   6    6    6
  549.               Square Root    V |    744      0 |    0    0    0 |   0    0    0
  550.               Subtraction    - |   3528      0 |    0    0    0 |   0    0    0
  551.                 Remainder    % |   2984      0 |    0    0    0 |   0    0    0
  552.                         Totals |  31102    133 |
  553.  
  554.  
  555.          IEEETEST output for IIT 3C87
  556.  
  557.          IEEE-754 Test Vector  Precisions: S=Single D=Double E=Double Extended
  558.                                |     TESTS     | numeric TYPE OF FAILURE flag
  559.                 Operation Code | Passed Failed |    S    D    E |   S    D    E
  560.          ----------------------------------------------------------------------
  561.            Absolute Value    A |    200     16 |    0    0   16 |   0    0    0
  562.                  Addition    + |   3336    192 |    0    0  128 |   0    0   96
  563.                Comparison    C |   4224     96 |    0    0   96 |   0    0    0
  564.                 Copy Sign    @ |   1488      0 |    0    0    0 |   0    0    0
  565.                  Division    / |   4159    152 |    0    0  124 |   0    0  116
  566.             Fraction Part    F |    600     24 |    0    0   24 |   0    0   24
  567.                      Logb    L |    960      0 |    0    0    0 |   0    0    0
  568.            Multiplication    * |   3702    276 |    0    0  248 |   0    0  100
  569.                  Negation    - |    200     16 |    0    0   16 |   0    0    0
  570.                Next After    N |   2248    584 |    0    0  584 |   0    0  168
  571.          Round to Integer    I |    542     16 |    0    0    4 |   0    0   16
  572.                     Scalb    S |    874     74 |    5    5   44 |   8    8   20
  573.               Square Root    V |    688     56 |    0    0   56 |   0    0   56
  574.               Subtraction    - |   3336    192 |    0    0  128 |   0    0   96
  575.                 Remainder    % |   2844    140 |    0    0  140 |   0    0  116
  576.                         Totals |  29401   1834 |
  577.  
  578.  
  579.          IEEETEST output for Intel 80287 run together with a 80386 CPU
  580.  
  581.          IEEE-754 Test Vector  Precisions: S=Single D=Double E=Double Extended
  582.                                |     TESTS     | numeric TYPE OF FAILURE flag
  583.                 Operation Code | Passed Failed |    S    D    E |   S    D    E
  584.          ----------------------------------------------------------------------
  585.            Absolute Value    A |    216      0 |    0    0    0 |   0    0    0
  586.                  Addition    + |   2886    642 |   16   16  112 | 174  174  174
  587.                Comparison    C |      0   4320 | 1324 1324 1324 |1332 1332 1332
  588.                 Copy Sign    @ |   1488      0 |    0    0    0 |   0    0    0
  589.                  Division    / |   3777    534 |   18   18   37 | 169  169  165
  590.             Fraction Part    F |    552     72 |   24   24   24 |  24   24   24
  591.                      Logb    L |    900     60 |   12   12   12 |  20   20   20
  592.            Multiplication    * |   2944   1034 |  105  105  197 | 303  303  231
  593.                  Negation    - |    216      0 |    0    0    0 |   0    0    0
  594.                Next After    N |    348   2484 |  768  768  768 | 504  504  526
  595.          Round to Integer    I |    546     12 |    0    0    0 |   4    4    4
  596.                     Scalb    S |    663    285 |   45   43   26 | 102   98   46
  597.               Square Root    V |    720     24 |    4    4    4 |   8    8    8
  598.               Subtraction    - |   2886    642 |   16   16  112 | 174  174  174
  599.                 Remainder    % |    708   2276 |  768  768  560 | 216  216  216
  600.                         Totals |  18850  12385 |
  601.  
  602.  
  603.          IEEETEST output for EM87 coprocessor emulator run on a Intel 386 CPU
  604.  
  605.          IEEE-754 Test Vector  Precisions: S=Single D=Double E=Double Extended
  606.                                |     TESTS     | numeric TYPE OF FAILURE flag
  607.                 Operation Code | Passed Failed |    S    D    E |   S    D    E
  608.          ----------------------------------------------------------------------
  609.            Absolute Value    A |    216      0 |    0    0    0 |   0    0    0
  610.                  Addition    + |   2886    642 |   16   16  112 | 174  174  174
  611.                Comparison    C |      0   4320 | 1324 1324 1324 |1332 1332 1332
  612.                 Copy Sign    @ |   1488      0 |    0    0    0 |   0    0    0
  613.                  Division    / |   3777    534 |   18   18   37 | 169  169  165
  614.             Fraction Part    F |    552     72 |   24   24   24 |  24   24   24
  615.                      Logb    L |    900     60 |   12   12   12 |  20   20   20
  616.            Multiplication    * |   2944   1034 |  105  105  197 | 303  303  231
  617.                  Negation    - |    216      0 |    0    0    0 |   0    0    0
  618.                Next After    N |    348   2484 |  768  768  768 | 504  504  526
  619.          Round to Integer    I |    546     12 |    0    0    0 |   4    4    4
  620.                     Scalb    S |    663    285 |   45   43   26 | 102   98   46
  621.               Square Root    V |    720     24 |    4    4    4 |   8    8    8
  622.               Subtraction    - |   2886    642 |   16   16  112 | 174  174  174
  623.  
  624.  
  625.          To complement the checks done by IEEETEST I wrote some short
  626.          programs DENORMTS, RCTRL, PCTRL in Turbo Pascal 6.0 that test
  627.          the following features:
  628.  
  629.          1. support for denormals in all precisions (single, double, extended)
  630.          2. support for the four IEEE rounding modes (up, down, nearest, chop)
  631.          3. support for precision control
  632.  
  633.          Note that 1) and 2) are required for IEEE conformance, while 3)
  634.          is required for compatibility with Intel's coprocessors. Precision
  635.          control forces the results of the FADD, FSUB, FMUL, FDIV, and FSQRT
  636.          instruction to be rounded to the specified precision (single, double,
  637.          double extended). This feature is provided to obtain compatibility
  638.          with certain programming languages [17]. By specifying lower
  639.          precision, one effectively nullifies the advantages of extended
  640.          precision intermediate results. The programs that test precision
  641.          control and rounding control are designed to return a different
  642.          result for each of the modes for the same sequence of operation.
  643.          The source code of the programs can be found in appendix A. The
  644.          Intel 8087 and 80287 were not tested with DENORMTS since Turbo
  645.          Pascal does not support extended precision denormals on 8087/80287
  646.          processors, so the denormal test fails anyway. The 8087 and 287
  647.          pass the RCTRL and PCTRL tests, though.
  648.  
  649.  
  650.          These are the results for the Intel 387, Intel 387DX, Intel 486,
  651.          Intel RapidCAD, Cyrix 83D87, Cyrix 387+, and the EM87 emulator
  652.          (on a 80386 machine)
  653.  
  654.          Precision Control           SINGLE   1.13311278820037842E+0000
  655.                                      DOUBLE   1.23456789006442125E+0000
  656.                                      EXTENDED 1.23456789012337585E+0000
  657.  
  658.          Rounding Control            NEAREST -1.23427629010100635E+0100
  659.                                      DOWN    -1.23427623555772409E+0100
  660.                                      UP      -1.23457760966801097E+0100
  661.                                      CHOP    -1.23397493540770643E+0100
  662.  
  663.          Denormal support
  664.  
  665.          SINGLE denormals supported
  666.          SINGLE denormal prints as:    4.60943116855005E-0041
  667.          Denormal should be printed as 4.60943...E-0041
  668.  
  669.          DOUBLE denormals supported
  670.          DOUBLE denormal prints as:    8.75000000000016E-0311
  671.          Denormal should be printed as 8.75...E-0311
  672.  
  673.          EXTENDED denormals supported
  674.          EXTENDED denormal prints as:  1.31640625000000E-4934
  675.          Denormal should be printed as 1.3164...E-4934
  676.  
  677.  
  678.          These are the results for the ULSI 83C87
  679.  
  680.          Precision Control           SINGLE   1.23456789012337585E+0000
  681.                                      DOUBLE   1.23456789012337585E+0000
  682.                                      EXTENDED 1.23456789012337585E+0000
  683.  
  684.          Rounding Control            NEAREST -1.23427629010100635E+0100
  685.                                      DOWN    -1.23427623555772409E+0100
  686.                                      UP      -1.23457760966801097E+0100
  687.                                      CHOP    -1.23397493540770643E+0100
  688.  
  689.          Denormal support
  690.  
  691.          SINGLE denormals supported
  692.          SINGLE denormal prints as:    4.60943116855005E-0041
  693.          Denormal should be printed as 4.60943...E-0041
  694.  
  695.          DOUBLE denormals supported
  696.          DOUBLE denormal prints as:    8.75000000000016E-0311
  697.          Denormal should be printed as 8.75...E-0311
  698.  
  699.          EXTENDED denormals supported
  700.          EXTENDED denormal prints as:  1.31640625000000E-4934
  701.          Denormal should be printed as 1.3164...E-4934
  702.  
  703.  
  704.          These are the results for the IIT 3C87
  705.  
  706.          Precision Control           SINGLE   1.13311278820037842E+0000
  707.                                      DOUBLE   1.23456789006442125E+0000
  708.                                      EXTENDED 1.23456789012337585E+0000
  709.  
  710.          Rounding Control            NEAREST -1.23427629010100635E+0100
  711.                                      DOWN    -1.23427623555772409E+0100
  712.                                      UP      -1.23457760966801097E+0100
  713.                                      CHOP    -1.23397493540770643E+0100
  714.  
  715.          Denormal support
  716.  
  717.          SINGLE denormals supported
  718.          SINGLE denormal prints as:    4.60943116855005E-0041
  719.          Denormal should be printed as 4.60943...E-0041
  720.  
  721.          DOUBLE denormals supported
  722.          DOUBLE denormal prints as:    8.75000000000016E-0311
  723.          Denormal should be printed as 8.75...E-0311
  724.  
  725.          EXTENDED denormals not supported
  726.  
  727.  
  728.          These are the results for the TP 6.0 coprocessor emulator:
  729.  
  730.          Precision Control           SINGLE   1.23456789012351396E+0000
  731.                                      DOUBLE   1.23456789012351396E+0000
  732.                                      EXTENDED 1.23456789012351396E+0000
  733.  
  734.          Rounding Control            NEAREST -1.23457766383395931E+0100
  735.                                      DOWN    -1.23457766383395931E+0100
  736.                                      UP      -1.23457766383395931E+0100
  737.                                      CHOP    -1.23457766383395931E+0100
  738.  
  739.          Denormal support
  740.  
  741.          SINGLE denormals not supported
  742.          DOUBLE denormals not supported
  743.          EXTENDED denormals not supported
  744.  
  745.  
  746.          The test results show that the IIT 3C87 does not conform to the
  747.          IEEE-754 floating-point standard in that it does not support
  748.          denormals in double extended precision. The ULSI 83C87 is not
  749.          Intel 387 compatible in that it does not support precision control,
  750.          but allways uses double extended precision. The TP 6.0 emulator
  751.          supports neither precision control, rounding control nor support
  752.          for any denormals. In addition, its basic arithmetic operations
  753.          do not seem to conform to the IEEE standard as the results of
  754.          the test programs differ from that of any result computed by a
  755.          coprocessor for any mode.
  756.  
  757.  
  758.          With regard to the accuracy of transcendental functions, Cyrix
  759.          claims that the relative error of the transcendental functions
  760.          on the 83D87 never exceeds 0.5 units in the last place (0.5 ULP)
  761.          of the double extended format [13]. This means that the maximum
  762.          relative error is below 2**-64, while Intel's published error
  763.          limit is 2**-62. While Intel uses a modified CORDIC algorithm
  764.          [18,19] to compute the transcendental functions, Cyrix uses
  765.          rational approximations that utilize a very fast array multiplier.
  766.          For an explanation why this approach is superior to CORDIC with
  767.          todays technology, see [61]. Also, Cyrix uses an internal 75 bit
  768.          data path for the mantissa [15], so intermediate computations in
  769.          the generation of transcendental function values will enjoy some
  770.          additional accuracy over the 64 bits provided by the double
  771.          extended format. Using 75 mantissa bits also provides an advantage
  772.          over other coprocessors like the Intel 387DX and ULSI 83C87 which
  773.          use only a 68 bit data path for the mantissa [58,59]. Note that a
  774.          maximum relative error of 0.5 ULP for the Cyrix coprocessor does
  775.          not mean that it returns the 'exact' result (machine number closest
  776.          to infinitely precise result) all the time. Just consider the case
  777.          where the infinitely precise result of a transcendental function
  778.          falls nearly half way between two machine numbers. A relative error
  779.          of 0.5 ULP can cause the result to be either of the numbers after
  780.          rounding, depending on the direction of the error. But the 83D87
  781.          should deliver results that never differ from the 'exact' result
  782.          by more than one ULP. Cyrix also claims that its transcendental
  783.          functions satisfy the monotonicity criterion [13], a claim not
  784.          made by any of the competitors. Monotonicity means that for all
  785.          x1 > x2, it always follows that f(x1) >= f(x2) for an increasing
  786.          function like sin on [0..pi/4]. Likewise, for a decreasing
  787.          function like cos on [0..pi/4], for all x1 > x2, it follows that
  788.          f(x1) <= f(x2).
  789.  
  790.          The Weitek Abacus 3167 and 4167 implement only the basic arithmetic
  791.          operations (add, subtract, negate, multiply, divide, square root)
  792.          in hardware. Transcendental functions are provided via a software
  793.          library provided by Weitek. For these library functions Weitek
  794.          claims a maximum relative error of 5 ULPs [31,33] (ULP = Unit in
  795.          the Last Place, numeric weight of the least significant mantissa
  796.          bit). This means that the last three bits in the mantissa of a
  797.          double precision result can be wrong. Note that the Intel 387 and
  798.          compatible math coprocessors generate the transcendental functions
  799.          with a small relative error with regard to the _extended double
  800.          precision_ format. Thus, when rounded to double precision, their
  801.          function values are nearly always 'exact'. 387 type coprocessors
  802.          have superior accuracy when compared with Weitek's coprocesssors.
  803.  
  804.          The test diskette distributed with early versions of the
  805.          Cyrix 83D87 contained a program TRANCK that checks the
  806.          accuracy of the transcendental functions in the coprocessor
  807.          against a more precise software arithmetic [16]. I used this
  808.          program to compare the accuracy of the transcendental functions
  809.          on those 287/387/486 coprocessors/FPUs available to me. As TRANCK
  810.          will not accept negative numbers as intervall limits, I tested
  811.          each function on an intervall along the positive x-axis. The
  812.          functions tested are F2XM1 (2**x-1), FSIN (sine), FCOS (cosine),
  813.          FPTAN (tangent), FPATAN (arctangent), FYL2X (y * log2 (x)),
  814.          and FYL2XP1 (y * log2 (x+1)). These are all the transcendental
  815.          functions implemented on the 80387. Note that the square root
  816.          (FSQRT) is *not* a transcendental function. For every function,
  817.          100,000 arguments were evaluated. The arguments were uniformally
  818.          distributed within the intervall tested. The EM87 emulator could
  819.          not be checked with TRANCK, since the multiple precision package
  820.          in TRANCK would always return with an error message immediately.
  821.          However, the Franke387 could be tested and
  822.  
  823.  
  824.          Test results for accuracy of transcendental functions for double
  825.          extended precision as returned by the program TRANCK. 100,000
  826.          trials per function.
  827.  
  828.          %wrong      is the percentage of results that differ from the 'exact'
  829.                      result (infinitely precise result rounded to 64 bits)
  830.          ULP_hi      is the number of results where the returned result was
  831.                      greater than the 'exact' (correctly rounded) result by
  832.                      one ULP (the numeric weight of the last mantissa bit,
  833.                      2**-64 to 2**-63 depending of the size of the number).
  834.          ULPs_hi     is the number of results where the returned result was
  835.                      greater than the 'exact' result by two or more ULPs.
  836.          ULP_lo      is the number of results where the returned result was
  837.                      smaller than the 'exact' (correctly rounded) result by
  838.                      one ULP (the numeric weight of the last mantissa bit,
  839.                      2**-64 to 2**-63 depending of the size of the number).
  840.          ULPs_lo     is the number of results where the returned result was
  841.                      smaller than the 'exact' result by two or more ULPs.
  842.          max ULP err is the maximum deviation of a returned result from the
  843.                      'exact' answer expressed in ULPs.
  844.  
  845.  
  846.          Franke387 V2.4 emulator
  847.                                                                  max
  848.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  849.  
  850.          SIN    0,pi/4      39.042  25301     708  13029       4       2
  851.          COS    0,pi/4      75.714  49827   25887      0       0       3
  852.          TAN    0,pi/4      76.976  14230   10029  24323   28394       9
  853.          ATAN   0,1         55.826  26028    1529  24044    4225       4
  854.          2XM1   0,0.5       96.717      0       0  47910   48807       5
  855.          YL2XP1 0,sqrt(2)-1 93.007    578       9  27416   65004       8
  856.          YL2X   0.1,10      62.252  16817    4712  37082    3641    2953
  857.  
  858.  
  859.          INTEL 80287
  860.                                                                  max
  861.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  862.  
  863.          SIN    0,pi/4         N/A    N/A     N/A    N/A     N/A     N/A
  864.          COS    0,pi/4         N/A    N/A     N/A    N/A     N/A     N/A
  865.          TAN    0,pi/4      37.001  18756     524  17405     316       2
  866.          ATAN   0,1          9.666   6065       0   3601       0       1
  867.          2XM1   0,0.5       19.920      0       0  19920       0       1
  868.          YL2XP1 0,sqrt(2)-1  7.780    868       0   6912       0       1
  869.          YL2X   0.1,10       1.287    723       0    564       0       1
  870.  
  871.  
  872.          INTEL 387
  873.                                                                  max
  874.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  875.  
  876.          SIN    0,pi/4      28.872   2467       0  26392      13       2
  877.          COS    0,pi/4      27.213  27169      35      9       0       2
  878.          TAN    0,pi/4      10.532    441       0  10091       0       1
  879.          ATAN   0,1          7.088   2386       0   4691       1       2
  880.          2XM1   0,0.5       32.024      0       0  32024       0       1
  881.          YL2XP1 0,sqrt(2)-1 22.611   3461       0  19150       0       1
  882.          YL2X   0.1,10      13.020   6508       0   6512       0       1
  883.  
  884.  
  885.          INTEL 387DX
  886.                                                                  max
  887.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  888.  
  889.          SIN    0,pi/4      28.873   2467       0  26393      13       2
  890.          COS    0,pi/4      27.121  27090      22      9       0       2
  891.          TAN    0,pi/4      10.711    457       0  10254       0       1
  892.          ATAN   0,1          7.088   2386       0   4691       1       2
  893.          2XM1   0,0.5       32.024      0       0  32024       0       1
  894.          YL2XP1 0,sqrt(2)-1 22.611   3461       0  19150       0       1
  895.          YL2X   0.1,10      13.020   6508       0   6512       0       1
  896.  
  897.  
  898.          ULSI 83C87
  899.                                                                  max
  900.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  901.  
  902.          SIN    0,pi/4      35.530   4989       6  30238     297       2
  903.          COS    0,pi/4      43.989  11193     675  31393     728       2
  904.          TAN    0,pi/4      48.539  18880    1015  26349    2295       3
  905.          ATAN   0,1         20.858     62       0  20796       0       1
  906.          2XM1   0,0.5       21.257      4       0  21253       0       1
  907.          YL2XP1 0,sqrt(2)-1 27.893   9446       0  18213     234       2
  908.          YL2X   0.1,10      13.603   9816       0   3787       0       1
  909.  
  910.  
  911.          IIT 3C87
  912.                                                                  max
  913.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  914.  
  915.          SIN    0,pi/4      18.650  11171      0    7479       0       1
  916.          COS    0,pi/4       7.700   3024      0    4676       0       1
  917.          TAN    0,pi/4      20.973   9681      0   11291       1       2
  918.          ATAN   0,1         19.280  13186      0    6094       0       1
  919.          2XM1   0,0.5       25.660  17570      0    8090       0       1
  920.          YL2XP1 0,sqrt(2)-1 45.830  23503   1896   19654     777       3
  921.          YL2X   0.1,10      10.888   5638    357    4845      48       3
  922.  
  923.  
  924.          CYRIX 83D87
  925.                                                                  max
  926.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  927.  
  928.          SIN    0,pi/4       1.554   1015      0     539       0       1
  929.          COS    0,pi/4       0.925    143      0     782       0       1
  930.          TAN    0,pi/4       4.147    881      0    3266       0       1
  931.          ATAN   0,1          0.656    229      0     427       0       1
  932.          2XM1   0,0.5        2.628   1433      0    1194       0       1
  933.          YL2XP1 0,sqrt(2)-1  3.242    825      0    2417       0       1
  934.          YL2X   0.1,10       0.931    256      0     675       0       1
  935.  
  936.  
  937.          CYRIX 387+
  938.                                                                  max
  939.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  940.  
  941.          SIN    0,pi/4       1.486    864       0    622       0       1
  942.          COS    0,pi/4       2.072     12       0   2060       0       1
  943.          TAN    0,pi/4       0.602     63       0    539       0       1
  944.          ATAN   0,1          0.384     12       0    372       0       1
  945.          2XM1   0,0.5        1.985     27       0   1958       0       1
  946.          YL2XP1 0,sqrt(2)-1  3.662   1705       0   1957       0       1
  947.          YL2X   0.1,10       0.764    367       0    397       0       1
  948.  
  949.  
  950.          INTEL RapidCAD, Intel 486
  951.                                                                  max
  952.          funct. intervall   %wrong ULP_hi ULPs_hi ULP_lo ULPs_lo ULP err
  953.  
  954.          SIN    0,pi/4      16.991   1517       0  15474       0       1
  955.          COS    0,pi/4       9.003   7603       0   1400       0       1
  956.          TAN    0,pi/4      10.532    441       0  10091       0       1
  957.          ATAN   0,1          7.078   2386       0   4691       1       2
  958.          2XM1   0,0.5       32.025      0       0  32025       0       1
  959.          YL2XP1 0,sqrt(2)-1 21.800    533       0  21267       0       1
  960.          YL2X   0.1,10       3.894   1879       0   2015       0       1
  961.  
  962.  
  963.          The test results above indicate that all 80x87 compatibles do not
  964.          exceed Intel's stated error bound of 3 ULPs for the transcendental
  965.          functions. However, some coprocessors are more accurate than others.
  966.          Rating the coprocessors according to the accuracy of their trans-
  967.          cendental functions gives the following list (highest accuracy
  968.          first): Cyrix 387+, Cyrix 83D87, Intel 486, Intel RapidCAD, Intel
  969.          80287(!), Intel 387DX, Intel 80387, IIT 3C87, ULSI 83C87. The tests
  970.          also show that the problems with excessive inaccuracy of the trans-
  971.          cendental functions in early versions of the IIT coprocessors with
  972.          errors of up to 8 ULPs [8] have been eliminated. According to [56],
  973.          certain problems with the FPATAN instruction on the IIT 3C87 occuring
  974.          under the UNIX version of AutoCAD have been corrected in June, 1990.
  975.          The Franke387 has acceptable accuracy for the FSIN, FCOS, and FPATAN
  976.          instructions, taking into consideration that according to its
  977.          documentation, Franke387 uses only 64 bits of precision for the
  978.          intermediate results, while coprocessorsa typically use 68 bits
  979.          and more. However, the larger error in the FPTAN, F2XM1, FYL2XP1,
  980.          and especially the FYL2X operations show that the emulator doesn't
  981.          use state of the art algorithms, which ensure an error of only a
  982.          very few ULPs even if no extra precise intermediate results are
  983.          available.
  984.  
  985.  
  986.  
  987.