Guest User

ponce

a guest
Oct 9th, 2009
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 95.87 KB | None | 0 0
  1. http://www.byte.com/bmark/bmark.htm
  2. ----------------------------------------------------------------------------
  3.  
  4. BYTEmark
  5.  
  6. ----------------------------------------------------------------------------
  7.  
  8. This is release 2 of BYTE Magazine's BYTEmark benchmark program (previously
  9. known as BYTE's Native Mode Benchmarks). This document covers the Native
  10. Mode (a.k.a. Algorithm Level) tests; benchmarks designed to expose the
  11. capabilities of a system's CPU, FPU, and memory system. Another group of
  12. benchmarks within the BYTEmark suite includes the Application Simulation
  13. Benchmarks. They are detailed in a separate document. [NOTE: The
  14. documentation for the Application simulation benchmarks should appear before
  15. the end of March, 95. -- RG].
  16.  
  17. The Tests
  18.  
  19. The Native Mode portion of the BYTEmark consists of a number of well-known
  20. algorithms; some BYTE has used before in earlier versions of the benchmark,
  21. others are new. The complete suite consists of 10 tests:
  22.  
  23. Numeric sort - Sorts an array of 32-bit integers.
  24.  
  25. String sort - Sorts an array of strings of arbitrary length.
  26.  
  27. Bitfield - Executes a variety of bit manipulation functions.
  28.  
  29. Emulated floating-point - A small software floating-point package.
  30.  
  31. Fourier coefficients - A numerical analysis routine for calculating series
  32. approximations of waveforms.
  33.  
  34. Assignment algorithm - A well-known task allocation algorithm.
  35.  
  36. Huffman compression - A well-known text and graphics compression algorithm.
  37.  
  38. IDEA encryption - A relatively new block cipher algorithm.
  39.  
  40. Neural Net - A small but functional back-propagation network simulator.
  41.  
  42. LU Decomposition - A robust algorithm for solving linear equations.
  43.  
  44. A more complete description of each test can be found in later sections of
  45. this document.
  46.  
  47. BYTE built the BYTEmark with the multiplatform world foremost in mind. There
  48. were, of course, other considerations that we kept high on the list:
  49.  
  50. Real-world algorithms. The algorithms should actually do something. Previous
  51. benchmarks often moved gobs of bytes from one point to another, added or
  52. subtracted piles and piles of numbers, or (in some cases) actually executed
  53. NOP instructions. We should not belittle those tests of yesterday, they had
  54. their place. However, we think it better that tests be based on activities
  55. that are more complex in nature.
  56.  
  57. Easy to port. All the benchmarks are written in "vanilla" ANSI C. This
  58. provides us with the best chance of moving them quickly and accurately to
  59. new processors and operating systems as they appear. It also simplifies
  60. maintenance.
  61.  
  62. This means that as new 64-bit (and, perhaps, 128-bit) processors appear, the
  63. benchmarks can test them as soon as a compiler is available.
  64.  
  65. Comprehensive. The algorithms were derived from a variety of sources. Some
  66. are routines that BYTE had been using for some time. Others are routines
  67. derived from well-known texts in the computer science world. Furthermore,
  68. the algorithms differ in structure. Some simply "walk" sequentially through
  69. one-dimensional arrays. Others build and manipulate two-dimensional arrays.
  70. Finally, some benchmarks are "integer" tests, while others exercise the
  71. floating-point coprocessor (if one is available).
  72.  
  73. Scalable. We wanted these benchmarks to be useful across as wide a variety
  74. of systems as possible. We also wanted to give them a lifetime beyond the
  75. next wave of new processors.
  76.  
  77. To that end, we incorporated "dynamic workload adjustment." A complete
  78. description of this appears in a later section. In a nutshell, this allows
  79. the tests to "expand or contract" depending on the capabilities of the
  80. system under test, all the while providing consistent results so that fair
  81. and accurate comparisons are possible.
  82.  
  83. Honesty In Advertising
  84.  
  85. We'd be lying if we said that the BYTEmark was all the benchmarking that
  86. anyone would ever need to run on a system. It would be equally inaccurate to
  87. suggest that the tests are completely free of inadequacies. There are many
  88. things the tests do not do, there are shortcomings, and there are problems.
  89.  
  90. BYTE will continue to improve the BYTEmark. The source code is freely
  91. available, and we encourage vendors and users to examine the routines and
  92. provide us with their feedback. In this way, we assure fairness,
  93. comprehensiveness, and accuracy.
  94.  
  95. Still, as we mentioned, there are some shortcomings. Here are those we
  96. consider the most significant. Keep them in mind as you examine the results
  97. of the benchmarks now and in the future.
  98.  
  99. At the mercy of C compilers. Being written in ANSI C, the benchmark program
  100. is highly portable. This is a reflection of the "world we live in." If this
  101. were a one-processor world, we might stand a chance at hand-crafting a
  102. benchmark in assembly language. (At one time, that's exactly what BYTE did.)
  103. Not today, no way.
  104.  
  105. The upshot is that the benchmarks must be compiled. For broadest coverage,
  106. we selected ANSI C. And when they're compiled, the resulting executable's
  107. performance can be highly dependent on the capabilities of the C compiler.
  108. Today's benchmark results can be blown out of the water tomorrow if someone
  109. new enters the scene with an optimizing strategy that outperforms existing
  110. competition.
  111.  
  112. This concern is not easily waved off. It will require you to keep careful
  113. track of compiler version and optimization switches. As BYTE builds its
  114. database of benchmark results, version number and switch setting will become
  115. an integral part of that data. This will be true for published information
  116. as well, so that you can make comparisons fairly and accurately. BYTE will
  117. control the distribution of test results so that all relevant compiler
  118. information is attached to the data.
  119.  
  120. As a faint justification -- for those who think this situation results in
  121. "polluted" tests -- we should point out that we are in the same boat as all
  122. the other developers (at least, all those using C compilers -- and that's
  123. quite a sizeable group). If the only C compilers for a given system happen
  124. to be poor ones, everyone suffers. It's a fact that a given platform's
  125. ultimate potential depends as much on the development software available as
  126. on the technical achievements of the hardware design.
  127.  
  128. It's just CPU and FPU. It's very tempting to try to capture the performance
  129. of a machine in a single number. That has never been possible -- though it's
  130. been tried a lot -- and the gap between that ideal and reality will forever
  131. widen.
  132.  
  133. These benchmarks are meant to expose the theoretical upper limit of the CPU,
  134. FPU, and memory architecture of a system. They cannot measure video, disk,
  135. or network throughput (those are the domains of a different set of
  136. benchmarks). You should, therefore, use the results of these tests as part,
  137. not all, of any evaluation of a system.
  138.  
  139. Single threaded. Currently, each benchmark test uses only a single execution
  140. thread. It's unlikely that you'll find any modern operating system that does
  141. not have some multitasking component. How a system "scales" as more tasks
  142. are run simultaneously is an effect that the current benchmarks cannot
  143. explore.
  144.  
  145. BYTE is working on a future version of the tests that will solve this
  146. problem.
  147.  
  148. The tests are synthetic. This quite reasonable argument is based on the fact
  149. that people don't run benchmarks for a living, they run applications.
  150. Consequently, the only true measure of a system is how well it performs
  151. whatever applications you will be running. This, in fact, is the philosophy
  152. behind the BAPCo benchmarks.
  153.  
  154. This is not a point with which we would disagree. BYTE regularly makes use
  155. of a variety of application benchmarks. None of this suggests, however, that
  156. the BYTEmark benchmarks serve no purpose.
  157.  
  158. BYTEmark's results should be used as predictors. They can be moved to a new
  159. platform long before native applications will be ported. The BYTEmark
  160. benchmarks will therefore provide an early look at the potential of the
  161. machine. Additionally, the BYTEmark permits you to "home in" on an aspect of
  162. the overall architecture. How well does the system perform when executing
  163. floating-point computations? Does its memory architecture help or hinder the
  164. management of memory buffers that may fall on arbitrary address boundaries?
  165. How does the cache work with a program whose memory access favors moving
  166. randomly through memory as opposed to moving sequentially through memory?
  167.  
  168. The answers to these questions can give you a good idea of how well a system
  169. would support a particular class of applications. Only a synthetic benchmark
  170. can give the narrow view necessary to find the answers.
  171.  
  172. Dynamic Workloads
  173.  
  174. Our long history of benchmarking has taught us one thing above all others:
  175. Tomorrow's system will go faster than today's by an amount exceeding your
  176. wildest guess -- and then some. Dealing with this can become an unending
  177. race.
  178.  
  179. It goes like this: You design a benchmark algorithm, you specify its
  180. parameters (how big the array is, how many loops, etc.), you run it on
  181. today's latest super-microcomputer, collect your data, and go home. A new
  182. machine arrives the next day, you run your benchmark, and discover that the
  183. test executes so quickly that the resolution of the clock routine you're
  184. using can't keep up with it (i.e., the test is over and done before the
  185. system clock even has a chance to tick).
  186.  
  187. If you modify your routine, the figures you collected yesterday are no good.
  188. If you create a better clock routine by sneaking down into the system
  189. hardware, you can kiss portability goodbye.
  190.  
  191. The BYTEmark benchmarks solve this problem by a process we'll refer to as
  192. "dynamic workload adjustment." In principle, it simply means that if the
  193. test runs so fast that the system clock can't time it, the benchmark
  194. increases the test workload -- and keeps increasing it -- until enough time
  195. is consumed to gather reliable test results.
  196.  
  197. Here's an example.
  198.  
  199. The BYTEmark benchmarks perform timing using a "stopwatch" paradigm. The
  200. routine StartStopwatch() begins timing; StopStopwatch() ends timing and
  201. reports the elapsed time in clock ticks. Now, "clock ticks" is a value that
  202. varies from system to system. We'll presume that our test system provides
  203. 1000 clock ticks per second. (We'll also presume that the system actually
  204. updates its clock 1000 times per second. Surprisingly, some systems don't do
  205. that. One we know of will tell you that the clock provides 100 ticks per
  206. second, but updates the clock in 5- or 6-tick increments. The resolution is
  207. no better than somewhere around 1/18th of a second.) Here, when we say
  208. "system" we mean not only the computer system, but the environment provided
  209. by the C compiler. Interestingly, different C compilers for the same system
  210. will report different clock ticks per second.
  211.  
  212. Built into the benchmarks is a global variable called GLOBALMINTICKS. This
  213. variable is the minimum number of clock ticks that the benchmark will allow
  214. StopStopwatch() to report.
  215.  
  216. Suppose you run the Numeric Sort benchmark. The benchmark program will
  217. construct an array filled with random numbers, call StartStopwatch(), sort
  218. the array, and call StopStopwatch(). If the time reported in StopStopwatch()
  219. is less than GLOBALMINTICKS, then the benchmark will build two arrays, and
  220. try again. If sorting two arrays took less time than GLOBALMINTICKS, the
  221. process repeats with more arrays.
  222.  
  223. This goes on until the benchmark makes enough work so that an interval
  224. between StartStopwatch() and StopStopwatch() exceeds GLOBALMINTICKS. Once
  225. that happens, the test is actually run, and scores are calculated.
  226.  
  227. Notice that the benchmark didn't make bigger arrays, it made more arrays.
  228. That's because the time taken by the sort test does not increase linearly as
  229. the array grows, it increases by a factor of N*log(N) (where N is the size
  230. of the array).
  231.  
  232. This principle is applied to all the benchmark tests. A machine with a less
  233. accurate clock may be forced to sort more arrays at a time, but the results
  234. are given in arrays per second. In this way fast machines, slow machines,
  235. machines with accurate clocks, machines with less accurate clocks, can all
  236. be tested with the same code.
  237.  
  238. Confidence Intervals
  239.  
  240. Another built-in feature of the BYTEmark is a set of statistical-analysis
  241. routines. Running benchmarks is one thing; the question arises as to how
  242. many times should a test be run until you know you have a good sampling.
  243. Also, can you determine whether the test is stable (i.e., do results vary
  244. widely from one execution of the benchmark to the next)?
  245.  
  246. The BYTEmark keeps score as follows: Each test (a test being a numeric
  247. sort, a string sort, etc.) is run five times. These five scores are
  248. averaged, the standard deviation is determined, and a 95% confidence
  249. half-interval for the mean is calculated (using the student t
  250. distribution). This tells us that the true average lies -- with a 95%
  251. probability -- within plus or minus the confidence half-interval of
  252. the calculated average. If this half-interval is within 5% of the
  253. calculated average, the benchmarking stops. Otherwise, a new test is
  254. run and the calculations are repeated with all of the runs done so
  255. far, including the new one. The benchmark proceeds this way up to a
  256. total of 30 runs. If the length of the half-interval is still bigger
  257. than 5% of the calculated average then a warning issued that the
  258. results might not be statistically certain before the average is
  259. displayed.
  260.  
  261. ** Fixed a statistical bug here. Uwe F. Mayer
  262.  
  263. The upshot is that, for each benchmark test, the true average is -- with a
  264. 95% level of confidence -- within 5% of the average reported. Here, the
  265. "true average" is the average we would get were we able to run the tests
  266. over and over again an infinite number of times.
  267.  
  268. This specification ensures that the calculation of results is controlled;
  269. that someone running the tests in California will use the same technique for
  270. determining benchmark results as someone running the tests in New York.
  271.  
  272. In case there is uneven system load due to other processes while this
  273. benchmark suite executes, it might take longer to run the benchmark suite
  274. as compared to a run an unloaded system. This is because the benchmark does
  275. some statistical analysis to make sure that the reported results are
  276. statistically significant (as explained above), and a high variation in
  277. individual runs requires more runs to achieve the required statistical
  278. confidence.
  279.  
  280. *** added last the paragraph, Uwe F. Mayer
  281.  
  282. Interpreting Results
  283.  
  284. Of course, running the benchmarks can present you with a boatload of data.
  285. It can get mystifying, and some of the more esoteric statistical information
  286. is valuable only to a limited audience. The big question is: What does it
  287. all mean?
  288.  
  289. First, we should point out that the BYTEmark reports both "raw" and indexed
  290. scores for each test. The raw score for a particular test amounts to the
  291. "iterations per second" of that test. For example, the numeric sort test
  292. reports as its raw score the number of arrays it was able to sort per
  293. second.
  294.  
  295. The indexed score is the raw score of the system under test divided by the
  296. raw score obtained on the baseline machine. As of this release, the
  297. baseline machine is a DELL 90 Mhz Pentium XPS/90 with 16 MB of RAM and 256K
  298. of external processor cache. (The compiler used was the Watcom C/C++ 10.0
  299. compiler; optimizations set to "fastest possible code", 4-byte structure
  300. alignment, Pentium code generation with Pentium register-based calling. The
  301. operating system was MSDOS.) The indexed score serves to "normalize" the
  302. raw scores, reducing their dynamic range and making them easier to
  303. grasp. Simply put, if your machine has an index score of 2.0 on the numeric
  304. sort test, it performed that test twice as fast as this 90 Mhz Pentium.
  305.  
  306. If you run all the tests (as you'll see, it is possible to perform "custom
  307. runs", which execute only a subset of the tests) the BYTEmark will also
  308. produce two overall index figures: Integer index and Floating-point index.
  309. The Integer index is the geometric mean of those tests that involve only
  310. integer processing -- numeric sort, string sort, bitfield, emulated
  311. floating-point, assignment, Huffman, and IDEA -- while the Floating-point
  312. index is the geometric mean of those tests that require the floating-point
  313. coprocessor -- Fourier, neural net, and LU decomposition. You can use these
  314. scores to get a general feel for the performance of the machine under test
  315. as compared to the baseline 90 Mhz Pentium.
  316.  
  317. The Linux/Unix port has a second baseline machine, it is an AMD K6/233 with
  318. 32 MB RAM and 512 KB L2-cache running Linux 2.0.32 and using GNU gcc
  319. version 2.7.2.3 and libc-5.4.38. The integer index was split as suggested
  320. by Andrew D. Balsa <[email protected]>, and reflects the realization that
  321. memory management is important in CPU design. The original tests have been
  322. left alone, however, the geometric mean of the tests NUMERIC SORT, FP
  323. EMULATION, IDEA, and HUFFMAN now constitutes the integer-arithmetic focused
  324. benchmark index, while the geometric mean of the tests STRING SORT,
  325. BITFIELD, and ASSIGNMENT makes up the new memory index. The floating point
  326. index has been left alone, it is still the geometric mean of FOURIER,
  327. NEURAL NET, and LU DECOMPOSITION.
  328.  
  329. *** added the section on Linux, Uwe F. Mayer
  330.  
  331. What follows is a list of the benchmarks and associated brief remarks that
  332. describe what the tests do: What they exercise; what a "good" result or a
  333. "bad" result means. Keep in mind that, in this expanding universe of faster
  334. processors, bigger caches, more elaborate memory architectures, "good" and
  335. "bad" are indeed relative terms. A good score on today's hot new processor
  336. will be a bad score on tomorrow's hot new processor.
  337.  
  338. These remarks are based on empirical data and profiling that we have done to
  339. date. (NOTE: The profiling is limited to Intel and Motorola 68K on this
  340. release. As more data is gathered, we will be refining this section.
  341. 3/14/95--RG)
  342.  
  343. Benchmark Description
  344.  
  345. Numeric sort Generic integer performance. Should
  346. exercise non-sequential performance
  347. of cache (or memory if cache is less
  348. than 8K). Moves 32-bit longs at a
  349. time, so 16-bit processors will be
  350. at a disadvantage.
  351.  
  352.  
  353.  
  354. String sort Tests memory-move performance.
  355. Should exercise non-sequential
  356. performance of cache, with added
  357. burden that moves are byte-wide and
  358. can occur on odd address boundaries.
  359. May tax the performance of
  360. cell-based processors that must
  361. perform additional shift operations
  362. to deal with bytes.
  363.  
  364.  
  365.  
  366. Bitfield Exercises "bit twiddling"
  367. performance. Travels through memory
  368. in a somewhat sequential fashion;
  369. different from sorts in that data is
  370. merely altered in place. If
  371. properly compiled, takes into
  372. account 64-bit processors, which
  373. should see a boost.
  374.  
  375.  
  376.  
  377. Emulated F.P. Past experience has shown this test
  378. to be a good measurement of overall
  379. performance.
  380.  
  381.  
  382.  
  383. Fourier Good measure of transcendental and
  384. trigonometric performance of FPU.
  385. Little array activity, so this test
  386. should not be dependent of cache or
  387. memory architecture.
  388.  
  389.  
  390.  
  391. Assignment The test moves through large integer
  392. arrays in both row-wise and
  393. column-wise fashion. Cache/memory
  394. with good sequential performance
  395. should see a boost (memory is
  396. altered in place -- no moving as in
  397. a sort operation). Processing is
  398. done in 32-bit chunks -- no
  399. advantage given to 64-bit
  400. processors.
  401.  
  402.  
  403.  
  404. Huffman A combination of byte operations,
  405. bit twiddling, and overall integer
  406. manipulation. Should be a good
  407. general measurement.
  408.  
  409.  
  410.  
  411. IDEA Moves through data sequentially in
  412. 16-bit chunks. Should provide a
  413. good indication of raw speed.
  414.  
  415.  
  416.  
  417. Neural Net Small-array floating-point test
  418. heavily dependent on the exponential
  419. function; less dependent on overall
  420. FPU performance. Small arrays, so
  421. cache/memory architecture should not
  422. come into play.
  423.  
  424.  
  425.  
  426. LU decomposition. A floating-point test that moves
  427. through arrays in both row-wise and
  428. column-wise fashion. Exercises only
  429. fundamental math operations (+, -,
  430. *, /).
  431.  
  432. The Command File
  433.  
  434. Purpose
  435.  
  436. The BYTEmark program allows you to override many of its default parameters
  437. using a command file. The command file also lets you request statistical
  438. information, as well as specify an output file to hold the test results for
  439. later use.
  440.  
  441. You identify the command file using a command-line argument. E.G.,
  442.  
  443. C:NBENCH -cCOMFILE.DAT
  444.  
  445. tells the benchmark program to read from COMFILE.DAT in the current
  446. directory.
  447.  
  448. The content of the command file is simply a series of parameter names and
  449. values, each on a single line. The parameters control internal variables
  450. that are either global in nature (i.e., they effect all tests in the
  451. program) or are specific to a given benchmark test.
  452.  
  453. The parameters are listed in a reference guide that follows, arranged in the
  454. following groups:
  455.  
  456. Global Parameters
  457.  
  458. Numeric Sort
  459.  
  460. String Sort
  461.  
  462. Bitfield
  463.  
  464. Emulated floating-point
  465.  
  466. Fourier coefficients
  467.  
  468. Assignment algorithm
  469.  
  470. IDEA encryption
  471.  
  472. Huffman compression
  473.  
  474. Neural net
  475.  
  476. LU decomposition
  477.  
  478. As mentioned above, those items listed under "Global Parameters" affect all
  479. tests; the rest deal with specific benchmarks. There is no required ordering
  480. to parameters as they appear in the command file. You can specify them in
  481. any sequence you wish.
  482.  
  483. You should be judicious in your use of a command file. Some parameters will
  484. override the "dynamic workload" adjustment that each test performs. Doing
  485. this completely bypasses the benchmark code that is designed to produce an
  486. accurate reading from your system clock. Other parameters will alter default
  487. settings, yielding test results that cannot be compared with published
  488. benchmark results.
  489.  
  490. A Sample Command File
  491.  
  492. Suppose you built a command file that contained the following:
  493.  
  494. ALLSTATS=T
  495.  
  496. CUSTOMRUN=T
  497.  
  498. OUTFILE=D:\DATA.DAT
  499.  
  500. DONUMSORT=T
  501.  
  502. DOLU=T
  503.  
  504. Here's what this file tells the benchmark program:
  505.  
  506. ALLSTATS=T means that you've requested a "dump" of all the statistics the
  507. test gathers. This includes not only the standard deviations of tests run,
  508. it also produces test-specific information such as the number of arrays
  509. built, the array size, etc.
  510.  
  511. CUSTOMRUN=T tells the system that this is a custom run. Only tests
  512. explicitly specified will be executed.
  513.  
  514. OUTFILE=D:\DATA.DAT will write the output of the benchmark to the file
  515. DATA.DAT on the root of the D: drive. (If DATA.DAT already exists, output
  516. will be appended to the file.)
  517.  
  518. DONUMSORT=T tells the system to run the numeric sort benchmark. (This was
  519. necessary on account of the CUSTOMRUN=T line, above.)
  520.  
  521. DOLU=T tells the system to run the LU decomposition benchmark.
  522.  
  523. Command File Parameters Reference
  524.  
  525. (NOTE: Altering some global parameters can invalidate results for comparison
  526. purposes. Those parameters are indicated in the following section by a bold
  527. asterisk (*). If you alter any parameters so indicated, you may NOT publish
  528. the resulting data as BYTEmark scores.)
  529.  
  530. Global Parameters
  531.  
  532. GLOBALMINTICKS=<n>
  533.  
  534. This overrides the default global_min_ticks value (defined in NBENCH1.H).
  535. The global_min_ticks value is defined as the minimum number of clock ticks
  536. per iteration of a particular benchmark. For example, if global_min_ticks is
  537. set to 100 and the numeric sort benchmark is run; each iteration MUST take
  538. at least 100 ticks, or the system will expand the work-per-iteration.
  539.  
  540. MINSECONDS=<n>
  541.  
  542. Sets the minimum number of seconds any particular test will run. This has
  543. the effect of controlling the number of repetitions done. Default: 5.
  544.  
  545. ALLSTATS=<T|F>
  546.  
  547. Set this flag to T for a "dump" of all statistics. The information displayed
  548. varies from test to test. Default: F.
  549.  
  550. OUTFILE=<path>
  551.  
  552. Specifies that output should go to the specified output file. Any test
  553. results and statistical data displayed on-screen will also be written to the
  554. file. If the file does not exist, it will be created; otherwise, new output
  555. will be appended to an existing file. This allows you to "capture" several
  556. runs into a single file for later review.
  557.  
  558. Note: the path should not appear in quotes. For example, something like the
  559. following would work: OUTFILE=C:\BENCH\DUMP.DAT
  560.  
  561. CUSTOMRUN=<T|F>
  562.  
  563. Set this flag to T for a custom run. A "custom run" means that the program
  564. will run only the benchmark tests that you explicitly specify. So, use this
  565. flag to run a subset of the tests. Default: F.
  566.  
  567. Numeric Sort
  568.  
  569. DONUMSORT=<T|F>
  570.  
  571. Indicates whether to do the numeric sort. Default is T, unless this is a
  572. custom run (CUSTOMRUN=T), in which case default is F.
  573.  
  574. NUMNUMARRAYS=<n>
  575.  
  576. Indicates the number of numeric arrays the system will build. Setting this
  577. value will override the program's "dynamic workload" adjustment for this
  578. test.*
  579.  
  580. NUMARRAYSIZE=<n>
  581.  
  582. Indicates the number of elements in each numeric array. Default is 8001
  583. entries. (NOTE: Altering this value will invalidate the test for comparison
  584. purposes. The performance of the numeric sort test is not related to the
  585. array size as a linear function; i.e., an array twice as big will not take
  586. twice as long. The relationship involves a logarithmic function.)*
  587.  
  588. NUMMINSECONDS=<n>
  589.  
  590. Overrides MINSECONDS for the numeric sort test.
  591.  
  592. String Sort
  593.  
  594. DOSTRINGSORT=<T|F>
  595.  
  596. Indicates whether to do the string sort. Default is T, unless this is a
  597. custom run (CUSTOMRUN=T), in which case the default is F.
  598.  
  599. STRARRAYSIZE=<n>
  600.  
  601. Sets the size of the string array. Default is 8111. (NOTE: Altering this
  602. value will invalidate the test for comparison purposes. The performance of
  603. the string sort test is not related to the array size as a linear function;
  604. i.e., an array twice as big will not take twice as long. The relationship
  605. involves a logarithmic function.)*
  606.  
  607. NUMSTRARRAYS=<n>
  608.  
  609. Sets the number of string arrays that will be created to run the test.
  610. Setting this value will override the program's "dynamic workload" adjustment
  611. for this test.*
  612.  
  613. STRMINSECONDS=<n>
  614.  
  615. Overrides MINSECONDS for the string sort test.
  616.  
  617. Bitfield
  618.  
  619. DOBITFIELD=<T|F>
  620.  
  621. Indicates whether to do the bitfield test. Default is T, unless this is a
  622. custom run (CUSTOMRUN=T), in which case the default is F.
  623.  
  624. NUMBITOPS=<n>
  625.  
  626. Sets the number of bitfield operations that will be performed. Setting this
  627. value will override the program's "dynamic workload" adjustment for this
  628. test.*
  629.  
  630. BITFIELDSIZE=<n>
  631.  
  632. Sets the number of 32-bit elements in the bitfield arrays. The default value
  633. is dependent on the size of a long as defined by the current compiler. For a
  634. typical compiler that defines a long to be 32 bits, the default is 32768.
  635. (NOTE: Altering this parameter will invalidate test results for comparison
  636. purposes.)*
  637.  
  638. BITMINSECONDS=<n>
  639.  
  640. Overrides MINSECONDS for the bitfield test.
  641.  
  642. Emulated floating-point
  643.  
  644. DOEMF=<T|F>
  645.  
  646. Indicates whether to do the emulated floating-point test. Default is T,
  647. unless this is a custom run (CUSTOMRUN=T), in which case the default is F.
  648.  
  649. EMFARRAYSIZE=<n>
  650.  
  651. Sets the size (number of elements) of the emulated floating-point benchmark.
  652. Default is 3000. The test builds three arrays, each of equal size. This
  653. parameter sets the number of elements for EACH array. (NOTE: Altering this
  654. parameter will invalidate test results for comparison purposes.)*
  655.  
  656. EMFLOOPS=<n>
  657.  
  658. Sets the number of loops per iteration of the floating-point test. Setting
  659. this value will override the program's "dynamic workload" adjustment for
  660. this test.*
  661.  
  662. EMFMINSECONDS=<n>
  663.  
  664. Overrides MINSECONDS for the emulated floating-point test.
  665.  
  666. Fourier coefficients
  667.  
  668. DOFOUR=<T|F>
  669.  
  670. Indicates whether to do the Fourier test. Default is T, unless this is a
  671. custom run (CUSTOMRUN=T), in which case the default is F.
  672.  
  673. FOURASIZE=<n>
  674.  
  675. Sets the size of the array for the Fourier test. This sets the number of
  676. coefficients the test will derive. NOTE: Specifying this value will override
  677. the system's "dynamic workload" adjustment for this test, and may make the
  678. results invalid for comparison purposes.*
  679.  
  680. FOURMINSECONDS=<n>
  681.  
  682. Overrides MINSECONDS for the Fourier test.
  683.  
  684. Assignment Algorithm
  685.  
  686. DOASSIGN=<T|F>
  687.  
  688. Indicates whether to do the assignment algorithm test. Default is T, unless
  689. this is a custom run (CUSTOMRUN=T), in which case the default is F.
  690.  
  691. ASSIGNARRAYS=<n>
  692.  
  693. Indicates the number of arrays that will be built for the test. Specifying
  694. this value will override the system's "dynamic workload" adjustment for this
  695. test. (NOTE: The size of the arrays in the assignment algorithm is fixed at
  696. 101 x 101. Altering the array size requires adjusting global constants and
  697. recompiling; to do so, however, would invalidate test results.)*
  698.  
  699. ASSIGNMINSECONDS=<n>
  700.  
  701. Overrides MINSECONDS for the assignment algorithm test.
  702.  
  703. IDEA encryption
  704.  
  705. DOIDEA=<T|F>
  706.  
  707. Indicates whether to do the IDEA encryption test. Default is T, unless this
  708. is a custom run (CUSTOMRUN=T), in which case the default is F.
  709.  
  710. IDEAARRAYSIZE=<n>
  711.  
  712. Sets the size of the plain-text character array that will be encrypted by the
  713. test. Default is 4000. The benchmark actually builds 3 arrays: 1st
  714. plain-text, encrypted version, and 2nd plain-text. The 2nd plain-text array is
  715. the destination for the decryption process [part of the test]. All arrays
  716. are set to the same size. (NOTE: Specifying this value will invalidate test
  717. results for comparison purposes.)*
  718.  
  719. IDEALOOPS=<n>
  720.  
  721. Indicates the number of loops in the IDEA test. Specifying this value will
  722. override the system's "dynamic workload" adjustment for this test.*
  723.  
  724. IDEAMINSECONDS=<n>
  725.  
  726. Overrides MINSECONDS for the IDEA test.
  727.  
  728. Huffman compression
  729.  
  730. DOHUFF=<T|F>
  731.  
  732. Indicates whether to do the Huffman test. Default is T, unless this is a
  733. custom run (CUSTOMRUN=T), in which case the default is F.
  734.  
  735. HUFFARRAYSIZE=<n>
  736.  
  737. Sets the size of the string buffer that will be compressed using the Huffman
  738. test. The default is 5000. (NOTE: Altering this value will invalidate test
  739. results for comparison purposes.)*
  740.  
  741. HUFFLOOPS=<n>
  742.  
  743. Sets the number of loops in the Huffman test. Specifying this value will
  744. override the system's "dynamic workload" adjustment for this test.*
  745.  
  746. HUFFMINSECONDS=<n>
  747.  
  748. Overrides MINSECONDS for the Huffman test.
  749.  
  750. Neural net
  751.  
  752. DONNET=<T|F>
  753.  
  754. Indicates whether to do the Neural Net test. Default is T, unless this is a
  755. custom run (CUSTOMRUN=T), in which case the default is F.
  756.  
  757. NNETLOOPS=<n>
  758.  
  759. Sets the number of loops in the Neural Net test. NOTE: Altering this value
  760. overrides the benchmark's "dynamic workload" adjustment algorithm, and may
  761. invalidate the results for comparison purposes.*
  762.  
  763. NNETMINSECONDS=<n>
  764.  
  765. Overrides MINSECONDS for the Neural Net test.
  766.  
  767. LU decomposition
  768.  
  769. DOLU=<T|F>
  770.  
  771. Indicates whether to do the LU decomposition test. Default is T, unless this
  772. is a custom run (CUSTOMRUN=T), in which case the default is F.
  773.  
  774. LUNUMARRAYS=<n>
  775.  
  776. Sets the number of arrays in each iteration of the LU decomposition test.
  777. Specifying this value will override the system's "dynamic workload"
  778. adjustment for this test.*
  779.  
  780. LUMINSECONDS=<n>
  781.  
  782. Overrides MINSECONDS for the LU decomposition test.
  783.  
  784. Numeric Sort
  785.  
  786. Description
  787.  
  788. This benchmark is designed to explore how well the system sorts a numeric
  789. array. In this case, a numeric array is a one-dimensional collection of
  790. signed, 32-bit integers. The actual sorting is performed by a heapsort
  791. algorithm (see the text box following for a description of the heapsort
  792. algorithm).
  793.  
  794. It's probably unnecessary to point out (but we'll do it anyway) that sorting
  795. is a fundamental operation in computer application software. You'll likely
  796. find sorting routines nestled deep inside a variety of applications;
  797. everything from database systems to operating-systems kernels.
  798.  
  799. The numeric sort benchmark reports the number of arrays it was able to sort
  800. per second. The array size is set by a global constant (it can be overridden
  801. by the command file -- see below).
  802.  
  803. Analysis
  804.  
  805. Optimized 486 code: Profiling of the numeric sort benchmark using Watcom's
  806. profiler (Watcom C/C++ 10.0) indicates that the algorithm spends most of its
  807. time in the numsift() function (specifically, about 90% of the benchmark's
  808. time takes place in numsift()). Within numsift(), two if statements dominate
  809. time spent:
  810.  
  811. if(array[k]<array[k+1L]) and if(array[i]<array[k])
  812.  
  813. Both statements involve indexes into arrays, so it's likely the processor is
  814. spending a lot of time resolving the array references. (Though both
  815. statements involve "less-than" comparisons, we doubt that much time is
  816. consumed in performing the signed compare operation.) Though the first
  817. statement involves array elements that are adjacent to one another, the
  818. second does not. In fact, the second statement will probably involve
  819. elements that are far apart from one another during early passes through the
  820. sifting process. We expect that systems whose caching system pre-fetches
  821. contiguous elements (often in "burst" line fills) will not have any great
  822. advantage of systems without pre-fetch mechanisms.
  823.  
  824. Similar results were found when we profiled the numeric sort algorithm under
  825. the Borland C/C++ compiler.
  826.  
  827. 680x0 Code (Macintosh CodeWarrior): CodeWarrior's profiler is function
  828. based; consequently, it does not allow for line-by-line analysis as does the
  829. Watcom compiler's profiler.
  830.  
  831. However, the CodeWarrior profiler does give us enough information to note
  832. that NumSift() only accounts for about 28% of the time consumed by the
  833. benchmark. The outer routine, NumHeapSort() accounts for around 71% of the
  834. time taken. It will require additional analysis to determine why the two
  835. compilers -- Watcom and CodeWarrior divide the workload so differently. (It
  836. may have something to do with compiler architecture, or the act of profiling
  837. the code may produce results that are significantly different than how the
  838. program runs under normal conditions, though that would lead one to wonder
  839. what use profilers would be.)
  840.  
  841. Porting Considerations
  842.  
  843. The numeric sort routine should represent a trivial porting exercise. It is
  844. not an overly large benchmark in terms of source code. Additionally, the
  845. only external routines it calls on are for allocating and releasing memory,
  846. and managing the stopwatch.
  847.  
  848. The numeric sort benchmark depends on the following global definitions (note
  849. that these may be overridden by the command file):
  850.  
  851. NUMNUMARRAYS -- Sets the upper limit on the number of arrays that the
  852. benchmark will attempt to build. The numeric sort benchmark creates work for
  853. itself by requiring the system to sort more and more arrays...not bigger and
  854. bigger arrays. (The latter case would skew results, because the sorting time
  855. for heapsort is N log2 N - e.g., doubling the array size does not double the
  856. sort time.) This constant sets the upper limit to the number of arrays the
  857. system will build before it signals an error. The default value is 100, and
  858. may be changed if your system exceeds this limit.
  859.  
  860. NUMARRAYSIZE - Determines the size of each array built. It has been set to
  861. 8111L and should not be tampered with. The command file entry
  862. NUMARRAYSIZE=<n> can be used to change this value, but results produced by
  863. doing this will make your results incompatible with other runs of the
  864. benchmark (since results will be skewed -- see preceding paragraph).
  865.  
  866. To test for a correct execution of the numeric sort benchmark, #define the
  867. DEBUG symbol. This will enable code that verifies that arrays are properly
  868. sorted. You should run the benchmark program using a command file that has
  869. only the numeric sort test enabled. If there is an error, the program will
  870. display "SORT ERROR" (If this happens, it's possible that tons of "SORT
  871. ERROR" messages will be emitted, so it's best not to redirect output to a
  872. file), otherwise it will print "Numeric sort: OK" (also quite a few times).
  873.  
  874. References
  875.  
  876. Gonnet, G.H. 1984, Handbook of Algorithms and Data Structures (Reading, MA:
  877. Addison-Wesley).
  878.  
  879. Knuth, Donald E. 1968, Fundamental Algorithms, vol 1 of The Art of Computer
  880. Programming (Reading, MA: Addison-Wesley).
  881.  
  882. Press, William H., Flannery, Brian P., Teukolsky, Saul A., and Vetterling,
  883. William T. 1989, Numerical Recipes in Pascal (Cambridge: Cambridge
  884. University Press).
  885.  
  886. Heapsort
  887.  
  888. The heapsort algorithm is well-covered in a number of the popular
  889. computer-science textbooks. In fact, it gets a pat on the back in Numerical
  890. Recipes (Press et. al.), where the authors write:
  891.  
  892. Heapsort is our favorite sorting routine. It can be recommended
  893. wholeheartedly for a variety of sorting applications. It is a true
  894. "in-place" sort, requiring no auxiliary storage.
  895.  
  896. Heapsort works by building the array into a kind of a queue called a heap.
  897. You can imagine this heap as being a form of in-memory binary tree. The
  898. topmost (root) element of the tree is the element that -- were the array
  899. sorted -- would be the largest element in the array. Sorting takes place by
  900. first constructing the heap, then pulling the root off the tree, promoting
  901. the next largest element to the root, pulling it off, and so on. (The
  902. promotion process is known as "sifting up.")
  903.  
  904. Heapsort executes in N log2 N time even in its worst case. Unlike some other
  905. sorting algorithms, it does not benefit from a partially sorted array
  906. (though Gonnet does refer to a variation of heapsort, called "smoothsort,"
  907. which does -- see references).
  908.  
  909. String Sort
  910.  
  911. Description
  912.  
  913. This benchmark is designed to gauge how well the system moves bytes around.
  914. By that we mean, how well the system can copy a string of bytes from one
  915. location to another; source and destination being aligned to arbitrary
  916. addresses. (This is unlike the numeric sort array, which moves bytes
  917. longword-at-a-time.) The strings themselves are built so as to be of random
  918. length, ranging from no fewer than 4 bytes and no greater than 80 bytes. The
  919. mixture of random lengths means that processors will be forced to deal with
  920. strings that begin and end on arbitrary address boundaries.
  921.  
  922. The string sort benchmark uses the heapsort algorithm; this is the same
  923. algorithm as is used in the numeric sort benchmark (see the sidebar on the
  924. heapsort for a detailed description of the algorithm).
  925.  
  926. Manipulation of the strings is actually handled by two arrays. One array
  927. holds the strings themselves; the other is a pointers array. Each member of
  928. the pointers array carries an offset that points into the string array, so
  929. that the ith pointer carries the offset to the ith string. This allows the
  930. benchmark to rapidly locate the position of the ith string. (The sorting
  931. algorithm requires exchanges of items that might be "distant" from one
  932. another in the array. It's critical that the routine be able to rapidly find
  933. a string based on its indexed position in the array.)
  934.  
  935. The string sort benchmark reports the number of string arrays it was able to
  936. sort per second. The size of the array is set by a global constant.
  937.  
  938. Analysis
  939.  
  940. Optimized 486 code (Watcom C/C++ 10.0): Profiling of the string sort
  941. benchmark indicates that it spends most of its time in the C library routine
  942. memmove(). Within that routine, most of the execution is consumed by a pair
  943. of instructions: rep movsw and rep movsd. These are repeated string move --
  944. word width and repeated string move -- doubleword width, respectively.
  945.  
  946. This is precisely where we want to see the time spent. It's interesting to
  947. note that the memmove() of the particular compiler/profiler tested (Watcom
  948. C/C++ 10.0) was "smart" enough to do most of the moving on word or
  949. doubleword boundaries. The string sort benchmark specifically sets arbitrary
  950. boundaries, so we'd expect to see lots of byte-wide moves. The "smart"
  951. memmove() is able to move bytes only when it has to, and does the remainder
  952. of the work via words and doublewords (which can move more bits at a time).
  953.  
  954. 680x0 Code (Macintosh CodeWarrior): Because CodeWarrior's profiler is
  955. function based, it is impossible to get an idea of how much time the test
  956. spends in library routines such as memmove(). Fortunately, as an artifact of
  957. the early version of the benchmark, the string sort algorithm makes use of
  958. the MoveMemory() routine in the sysspec.c file (system specific routines).
  959. This call, on anything other than a 16-bit DOS system, calls memmove()
  960. directly. Hence, we can get a good approximation of how much time is spent
  961. moving bytes.
  962.  
  963. The answer is that nearly 78% of the benchmark's time is consumed by
  964. MoveMemory(), the rest being taken up by the other routines (the
  965. str_is_less() routine, which performs string comparisons, takes about 7% of
  966. the time). As above, we can guess that most of the benchmark's time is
  967. dependent on the performance of the library's memmove() routine.
  968.  
  969. Porting Considerations
  970.  
  971. As with the numeric sort routine, the string sort benchmark should be simple
  972. to port. Simpler, in fact. The string sort benchmark routine is not
  973. dependent on any typedef that may change from machine to machine (unless a
  974. char type is not 8 bits).
  975.  
  976. The string sort benchmark depends on the following global definitions:
  977.  
  978. NUMSTRARRAYS - Sets the upper limit on the number of arrays that the
  979. benchmark will attempt to build. The string sort benchmark creates work for
  980. itself by requiring the system to sort more and more arrays, not bigger and
  981. bigger arrays. (See section on Numeric Sort for an explanation.) This
  982. constant sets the upper limit to the number of arrays the system will build
  983. before it signals an error. The default value is 100, and may be changed if
  984. your system exceeds this limit.
  985.  
  986. STRARRAYSIZE - Sets the default size of the string arrays built. We say
  987. "arrays" because, as with the numeric sort benchmark, the system adds work
  988. not by expanding the size of the array, but by adding more arrays. This
  989. value is set to 8111, and should not be modified, since results would not be
  990. comparable with other runs of the same benchmark on other machines.
  991.  
  992. To test for a correct execution of the string sort benchmark, #define
  993. the DEBUG symbol. This will enable code that verifies the arrays are
  994. properly sorted. Set up a command file that runs only the string sort,
  995. and execute the benchmark program. If the routine is operating
  996. properly, the benchmark will print "String sort: OK", this message is
  997. printed quite often. Otherwise, the program will display "SORT ERROR"
  998. for each pair of strings it finds out of order (which can be really
  999. often).
  1000.  
  1001. References
  1002.  
  1003. See the references for the Numeric Sort benchmark.
  1004.  
  1005. Bitfield Operations
  1006.  
  1007. Description
  1008.  
  1009. The purpose of this benchmark is to explore how efficiently the system
  1010. executes operations that deal with "twiddling bits." The test is set up to
  1011. simulate a "bit map"; a data structure used to keep track of storage usage.
  1012. (Don't confuse this meaning of "bitmap" with its use in describing a
  1013. graphics data structure.)
  1014.  
  1015. Systems often use bit maps to keep an inventory of memory blocks or (more
  1016. frequently) disk blocks. In the case of a bit map that manages disk usage,
  1017. an operating system will set aside a buffer in memory so that each bit in
  1018. that buffer corresponds to a block on the disk drive. A 0 bit means that the
  1019. corresponding block is free; a 1 bit means the block is in use. Whenever a
  1020. file requests a new block of disk storage, the operating system searches the
  1021. bit map for the first 0 bit, sets the bit (to indicate that the block is now
  1022. spoken for), and returns the number of the corresponding disk block to the
  1023. requesting file.
  1024.  
  1025. These types of operations are precisely what this test simulates. A block of
  1026. memory is set allocated for the bit map. Another block of memory is
  1027. allocated, and set up to hold a series of "bit map commands". Each bitmap
  1028. command tells the simulation to do 1 of 3 things:
  1029.  
  1030. 1) Clear a series of consecutive bits,
  1031.  
  1032. 2) Set a series of consecutive bits, or
  1033.  
  1034. 3) Complement (1->0 and 0->1) a series of consecutive bits.
  1035.  
  1036. The bit map command block is loaded with a set of random bit map commands
  1037. (each command covers an random number of bits), and simulation routine steps
  1038. sequentially through the command block, grabbing a command and executing it.
  1039.  
  1040. The bitfield benchmark reports the number of bits it was able to operate on
  1041. per second. The size of the bit map is constant; the bitfield operations
  1042. array is adjusted based on the capabilities of the processor. (See the
  1043. section describing the auto-adjust feature of the benchmarks.)
  1044.  
  1045. Analysis
  1046.  
  1047. Optimized 486 code: Using the Watcom C/C++ 10.0 profiler, the Bitfield
  1048. benchmark appears to spend all of its time in two routines: ToggleBitRun()
  1049. (74% of the time) and DoBitFieldIteration() (24% of the time). We say
  1050. "appears" because this is misleading, as we will explain.
  1051.  
  1052. First, it is important to recall that the test performs one of three
  1053. operations for each run of bits (see above). The routine ToggleBitRun()
  1054. handles two of those three operations: setting a run of bits and clearing a
  1055. run of bits. An if() statement inside ToggleBitRun() decides which of the
  1056. two operations is performed. (Speed freaks will quite rightly point out that
  1057. this slows the entire algorithm. ToggleBitRun() is called by a switch()
  1058. statement which has already decided whether bits should be set or cleared;
  1059. it's a waste of time to have ToggleBitRun() have to make that decision yet
  1060. again.)
  1061.  
  1062. DoBitFieldIteration() is the "outer" routine that calls ToggleBitRun().
  1063. DoBitFieldIteration() also calls FlipBitRun(). This latter routine is the
  1064. one that performs the third bitfield operation: complementing a run of bits.
  1065. FlipBitRun() gets no "air time" at all (while DoBitFieldIteration() gets 24
  1066. % of the time) simply because the compiler's optimizer recognizes that
  1067. FlipBitRun() is only called by DoBitFieldIteration(), and is called only
  1068. once. Consequently, the optimizer moves FlipBitRun() "inline", i.e., into
  1069. DoBitFieldIteration(). This removes an unnecessary call/return cycle (and is
  1070. probably part of the reason why the FlipBitRun() code gets 24% of the
  1071. algorithm's time, instead of something closer to 30% of its time.)
  1072.  
  1073. Within the routines, those lines of code that actually do the shifting, the
  1074. and operations, and the or operations, consume time evenly. This should make
  1075. for a good test of a processor's "bit twiddling" capabilities.
  1076.  
  1077. 680x0 Code (Macintosh CodeWarrior): The CodeWarrior profiler is function
  1078. based. Consequently, it is impossible to produce a profile of machine
  1079. instruction execution time. We can, however, get a good picture of how the
  1080. algorithm divides its time among the various functions.
  1081.  
  1082. Unlike the 486 compiler, the CodeWarrior compiler did not appear to collapse
  1083. the FlipBitRun() routine into the outer DoBitFieldIteration() routine. (We
  1084. don't know this for certain, of course. It's possible that the compiler
  1085. would have done this had we not been profiling.)
  1086.  
  1087. In any case, the time spent in the two "core" routines of the bitfield test
  1088. are shown below:
  1089.  
  1090. FlipBitRun() - 18031.2 microsecs (called 509 times)
  1091.  
  1092. ToggleBitRun() - 50770.6 microsecs (called 1031 times)
  1093.  
  1094. In terms of total time, FlipBitRun() takes about 35% of the time (it gets
  1095. about 33% of the calls). Remember, ToggleBitRun() is a single routine that
  1096. is called both to set and clear bits. Hence, ToggleBitRun() is called twice
  1097. as often as FlipBitRun().
  1098.  
  1099. We can conclude that time spent setting bits to 1, setting bits to 0, and
  1100. changing the state of bits, is about equal; the load is balanced close to
  1101. what we'd expect it to be, based on the structure of the algorithm.
  1102.  
  1103. Porting Considerations
  1104.  
  1105. The bitfield operations benchmark is dependent on the size of the long
  1106. datatype. On most systems, this is 32 bits. However, on some of the newer
  1107. RISC chips, a long can be 64 bits long. If your system does use 64-bit
  1108. longs, you'll need to #define the symbol LONG64.
  1109.  
  1110. If you are unsure of the size of a long in your system (some C compiler
  1111. manuals make it difficult to discover), simply place an ALLSTATS=T line in
  1112. the command file and run the benchmarks. This will cause the benchmark
  1113. program to display (among other things) the size of the data types int,
  1114. short, and long in bytes.
  1115.  
  1116. BITFARRAYSIZE - Sets the number of longs in the bit map array. This number
  1117. is fixed, and should not be altered. The bitfield test adjusts itself by
  1118. adding more bitfield commands (see above), not by creating a larger bit map.
  1119.  
  1120. Currently, there is no code added to test for correct execution. If you are
  1121. concerned that your port was incorrect, you'll need to step through your
  1122. favorite debugger and verify execution against the original source code.
  1123.  
  1124. ** I added a resetting of the random number generator, and a resetting
  1125. ** of the bitfield to each loop. Those operations are outside of the
  1126. ** timed loop, and should add to make the benchmark more consistent.
  1127. ** There also is now debugging information available. If you define
  1128. ** DEBUG then the program will write a file named "debugbit.dat",
  1129. ** which is the contents of the bitfield after the calibration loop of
  1130. ** 30 operations. You can compare this file with the file
  1131. ** "debugbit.good" that comes with the distribution.
  1132. ** Uwe F. Mayer <[email protected]>
  1133.  
  1134. References
  1135.  
  1136. None.
  1137.  
  1138. Emulated Floating-point
  1139.  
  1140. Description
  1141.  
  1142. The emulated floating-point benchmark includes routines that are similar to
  1143. those that would be executed whenever a system performs floating-point
  1144. operations in the absence of a coprocessor. In general, this amounts to a
  1145. mixture of integer instructions, including shift operations, integer
  1146. addition and subtraction, and bit testing (among others).
  1147.  
  1148. The benchmark itself is remarkably simple. The test builds three
  1149. 1-dimensional arrays and loads the first two up with random floating-point
  1150. numbers. The arrays are then partitioned into 4 equal-sized groups, and the
  1151. test proceeds by performing addition, subtraction, multiplication, and
  1152. division -- one operation on each group. (For example, for the addition
  1153. group, an element from the first array is added to the second array and the
  1154. result is placed in the third array.)
  1155.  
  1156. Of course, most of the work takes place inside the routines that perform the
  1157. addition, subtraction, multiplication, and division. These routines operate
  1158. on a special data type (referred to as an InternalFPF number) that -- though
  1159. not strictly IEEE compliant -- carries all the necessary data fields to
  1160. support an IEEE-compatible floating-point system. Specifically, an
  1161. InternalFPF number is built up of the following fields:
  1162.  
  1163. Type (indicates a NORMAL, SUBNORMAL, etc.)
  1164.  
  1165. Mantissa sign
  1166.  
  1167. Unbiased, signed 16-bit exponent
  1168.  
  1169. 4-word (16 bits) mantissa.
  1170.  
  1171. The emulated floating-point test reports its results in number of loops per
  1172. second (where a "loop" is one pass through the arrays as described above).
  1173.  
  1174. Finally, we are aware that this test could be on its way to becoming an
  1175. anachronism. A growing number of systems are appearing that have
  1176. coprocessors built into the main CPU. It's possible that floating-point
  1177. emulation will one day be a thing of the past.
  1178.  
  1179. Analysis
  1180.  
  1181. Optimized 486 code (Watcom C/C++ 10.0): The algorithm's time is distributed
  1182. across a number of routines. The distribution is:
  1183.  
  1184. ShiftMantLeft1() - 60% of the time
  1185.  
  1186. ShiftMantRight1() - 17% of the time
  1187.  
  1188. DivideInternalFPF() - 14% of the time
  1189.  
  1190. MultiplyInternalFPF() - 5% of the time.
  1191.  
  1192. The first two routines are similar to one another; both shift bits about in
  1193. a floating-point number's mantissa. It's reasonable that ShiftMantLeft1()
  1194. should take a larger share of the system's time; it is called as part of the
  1195. normalization process that concludes every emulated addition, subtraction,
  1196. mutiplication, and division.
  1197.  
  1198. 680x0 Code (Macintosh CodeWarrior): CodeWarrior's profiler is
  1199. function-based; consequently, it isn't possible to get timing at the machine
  1200. instruction level. However, the output to CodeWarrior's profiler has
  1201. provided insight into the breakdown of time spent in various functions that
  1202. forces us to rethink our 486 code analysis.
  1203.  
  1204. Analyzing what goes on inside the emulated floating-point tests is a tough
  1205. one to call because some of the routines that are part of the test are
  1206. called by the function that builds the arrays. Consequently, a quick look at
  1207. the profiler's output can be misleading; it's not obvious how much time a
  1208. particular routine is spending in the test and how much time that same
  1209. routine is spending setting up the test (an operation that does not get
  1210. timed).
  1211.  
  1212. Specifically, the routine that loads up the arrays with test data calls
  1213. LongToInternalFPF() and DivideInternalFPF(). LongToInternalFPF() makes one
  1214. call to normalize() if the number is not a true zero. In turn, normalize()
  1215. makes an indeterminate number of calls to ShiftMantLeft1(), depending on the
  1216. structure of the mantissa being normalized.
  1217.  
  1218. What's worse, DivideInternalFPF() makes all sorts of calls to all kinds of
  1219. important low-level routines such as Sub16Bits() and ShiftMantLeft1().
  1220. Untangling the wiring of which routine is being called as part of the test,
  1221. and which is being called as part of the setup could probably be done with
  1222. the computer equivalent of detective work and spelunking, but in the
  1223. interest of time we'll opt for approximation.
  1224.  
  1225. Here's a breakdown of some of the important routines and their times:
  1226.  
  1227. AddSubInternalFPF() - 1003.9 microsecs (called 9024 times)
  1228.  
  1229. MultiplyInternalFPF() - 20143 microsecs (called 5610 times)
  1230.  
  1231. DivideInternalFPF() - 18820.9 microsecs (called 3366 times).
  1232.  
  1233. The 3366 calls to DivideInternalFPF() are timed calls, not setup calls --
  1234. the profiler at least gives outputs of separate calls made to the same
  1235. routine, so we can determine which call is being made by the benchmark, and
  1236. which is being made by the setup routine. It turns out that the setup
  1237. routine calls DivideInternalFPF() 30,000 times.
  1238.  
  1239. Notice that though addition/subtraction are called most often,
  1240. multiplication next, then finally division; the time spent in each is the
  1241. reverse. Division takes the most time, then multiplication, finally
  1242. addition/subtraction. (There's probably some universal truth lurking here
  1243. somewhere, but we haven't found it yet.)
  1244.  
  1245. Other routines, and their breakdown:
  1246.  
  1247. Add16Bits() - 115.3 microsecs
  1248.  
  1249. ShiftMantRight1() - 574.2 microsecs
  1250.  
  1251. Sub16Bits() - 1762 microsecs
  1252.  
  1253. StickySiftRightMant - 40.4 microsecs
  1254.  
  1255. ShiftMantLeft1() - 17486.1 microsecs
  1256.  
  1257. The times for the last three routines are suspect, since they are called by
  1258. DivideInternalFPF(), and a large portion of their time could be part of the
  1259. setup process. This is what leads us to question the results obtained in the
  1260. 486 analysis, since it, too, is unable to determine precisely who is calling
  1261. whom.
  1262.  
  1263. Porting Considerations
  1264.  
  1265. Earlier versions of this benchmark were extremely sensitive to porting;
  1266. particularly to the "endianism" of the target system. We have tried to
  1267. eliminate many of these problems. The test is nonetheless more "sensitive"
  1268. to porting than most others.
  1269.  
  1270. Pay close attention to the following defines and typedefs. They can be found
  1271. in the files EMFLOAT.H, NMGLOBAL.H, and NBENCH1.H:
  1272.  
  1273. u8 - Stands for unsigned, 8-bit. Usually defined to be unsigned char.
  1274.  
  1275. u16 - Stands for unsigned, 16-bit. Usually defined to be unsigned short.
  1276.  
  1277. u32 - Stands for unsigned, 32-bit. Usually defined to be unsigned long.
  1278.  
  1279. INTERNAL_FPF_PRECISION - Indicates the number of elements in the mantissa of
  1280. an InternalFPF number. Should be set to 4.
  1281.  
  1282. The exponent field of an InternalFPF number is of type short. It should be
  1283. set to whatever minimal data type can hold a signed, 16-bit number.
  1284.  
  1285. Other global definitions you will want to be aware of:
  1286.  
  1287. CPUEMFLOATLOOPMAX - Sets the maximum number of loops the benchmark will
  1288. attempt before flagging an error. Each execution of a loop in the emulated
  1289. floating-point test is "non-destructive," since the test takes factors from
  1290. two arrays, operates on the factors, and places the result in a third array.
  1291. Consequently, the test makes more work for itself by increasing the number
  1292. of times it passes through the arrays (# of loops). If the system exceeds
  1293. the limit set by CPUEMFLOATLOOPMAX, it will signal an error.
  1294.  
  1295. This value may be altered to suit your system; it will not effect the
  1296. benchmark results (unless you reduce it so much the system can never
  1297. generate enough loops to produce a good test run).
  1298.  
  1299. EMFARRAYSIZE - Sets the size of the arrays to be used in the test. This
  1300. value is the number of entries (InternalFPF numbers) per array. Currently,
  1301. the number is fixed at 3000, and should not be altered.
  1302.  
  1303. Currently, there is no means of testing correct execution of the benchmark
  1304. other than via debugger. There are routines available to decode the internal
  1305. floating point format and print out the numbers, but no formal correctness
  1306. test has been constructed. (This should be available soon. -- 3/14/95 RG)
  1307.  
  1308. ** It now prints out the operations of 8 of the entries used in the
  1309. ** test. Assuming you leave EMFARRAYSIZE at 3000, your results should
  1310. ** look like the ones below. The number in front of the colon is the
  1311. ** index of the entry.
  1312. **
  1313. ** 2: (-1.1160E 0) + (-4.5159E 0) = -5.6320E 0
  1314. ** 6: (-4.4507E -1) - (-8.2050E -1) = +3.7543E -1
  1315. ** 10: (+1.2465E 0) * (+7.4667E -1) = +9.3075E -1
  1316. ** 14: (-1.2781E 0) / (-1.7367E 0) = +7.3596E -1
  1317. ** 2986: (-7.0390E 0) * (-2.0752E 0) = +1.4607E 1
  1318. ** 2990: (+8.3753E -1) / (+2.3876E 1) = +3.5078E -2
  1319. ** 2994: (-1.1393E 0) + (-1.6080E 1) = -1.7219E 1
  1320. ** 2998: (+7.2450E 0) - (-8.2654E -1) = +8.0716E 0
  1321. **
  1322. ** Uwe F. Mayer <[email protected]>
  1323.  
  1324. References
  1325.  
  1326. Microprocessor Programming for Computer Hobbyists, Neill Graham, Tab Books,
  1327. Blue Ridge Summit, PA, 1977.
  1328.  
  1329. Apple Numerica Manual, Second edition, Apple Computer, Addison-Wesley
  1330. Publishing Co., Reading, MA, 1988.
  1331.  
  1332. Fourier Series
  1333.  
  1334. Description
  1335.  
  1336. This is a floating-point benchmark designed primarily to exercise the
  1337. trigonometric and transcendental functions of the system. It calculates the
  1338. first n Fourier coefficients of the function (x+1)x on the interval 0,2. In
  1339. this case, the function (x+1)x is being treated as a cyclic waveform with a
  1340. period of 2.
  1341.  
  1342. The Fourier coefficients, when applied as factors to a properly constructed
  1343. series of sine and cosine functions, allow you to approximate the original
  1344. waveform. (In fact, if you can calculate all the Fourier coefficients --
  1345. there'll be an infinite number -- you can reconstruct the waveform exactly).
  1346. You have to calculate the coefficients via integration, and the algorithm
  1347. does this using a simple trapezoidal rule for its numeric integration
  1348. function.
  1349.  
  1350. The upshot of all this is that it provides an exercise for the
  1351. floating-point routines that calculate sine, cosine, and raising a number to
  1352. a power. There are also some floating-point multiplications, divisions,
  1353. additions, and subtractions mixed in.
  1354.  
  1355. The benchmark reports its results as the number of coefficients calculated
  1356. per second.
  1357.  
  1358. As an additional note, we should point out that the performance of this
  1359. benchmark is heavily dependent on how well-built the compiler's math library
  1360. is. We have seen at least two cases where recompilation with new (and
  1361. improved!) math libraries have resulted in two-fold and five-fold
  1362. performance improvements. (Apparently, when a compiler gets moved to a new
  1363. platform, the trigonometric and transcendental functions in the math
  1364. libraries are among the last routines to be "hand optimized" for the new
  1365. platform.) About all we can say about this is that whenever you run this
  1366. test, verify that you have the latest and greatest math libraries.
  1367.  
  1368. Analysis
  1369.  
  1370. Optimized 486 code: The benchmark partitions its time almost evenly among
  1371. the modules pow387, exp386, and trig387; giving between 25% and 28% of its
  1372. time to each. This is based on profiling with the Watcom compiler running
  1373. under Windows NT. These modules hold the routines that handle raising a
  1374. number to a power and performing trigonometric (sine and cosine)
  1375. calculations. For example, within trig387, time was nearly equally divided
  1376. between the routine that calculates sine and the routine that calculates
  1377. cosine.
  1378.  
  1379. The remaining time (between 17% and 18%) was spent in the balance of the
  1380. test. We noticed that most of that time occurred in the routine
  1381. thefunction(). This is at the heart of the numerical integration routine the
  1382. benchmark uses.
  1383.  
  1384. Consequently, this benchmark should be a good test of the exponential and
  1385. trigonometric capabilities of a processor. (Note that we recognize that the
  1386. performance also depends on how well the compiler's math library is built.)
  1387.  
  1388. 680x0 Code (Macintosh CodeWarrior): The CodeWarrior profiler is function
  1389. based, therefore it is impossible to get performance results for individual
  1390. machine instructions. The CodeWarrior compiler is also unable to tell us how
  1391. much time is spent within a given library routine; we can't see how much
  1392. time gets spent executing the sin(), cos(), or pow() functions (which,
  1393. unfortunately, was the whole idea behind the benchmark).
  1394.  
  1395. About all we can glean from the results is that thefunction() takes about
  1396. 74% of the time in the test (this is where the heavy math calculations take
  1397. place) while trapezoidintegrate() accounts for about 26% of the time on its
  1398. own.
  1399.  
  1400. Porting Considerations
  1401.  
  1402. Necessarily, this benchmark is at the mercy of the efficiency of the
  1403. floating-point support provided by whatever compiler you are using. It is
  1404. recommended that, if you are doing the port yourself, you contact the
  1405. designers of the compiler, and discuss with them what optimization switches
  1406. should be set to produce the fastest code. (This sounds simple; usually it's
  1407. not. Some systems let you decide between speed and true IEEE compliance.)
  1408.  
  1409. As far as global definitions go, this benchmark is happily free of them. All
  1410. the math is done using double data types. We have noticed that, on some Unix
  1411. systems, you must be careful to include the correct math libraries.
  1412. Typically, you'll discover this at link time.
  1413.  
  1414. To test for correct execution of the benchmark: It's unlikely you'll need to
  1415. do this, since the algorithm is so cut-and-dried. Furthermore, there are no
  1416. explicit provisions made to verify the correctness. You can, however, either
  1417. dip into your favorite debugger, or alter the code to print out the contents
  1418. of the abase (which holds the A[i] terms) and bbase (which holds the B[i]
  1419. terms) arrays as they are being filled (see routine DoFPUTransIteration).
  1420. ** This is exactly what I have done, it now prints out A[i] and B[i] data.
  1421. ** Uwe F. Mayer <[email protected]>
  1422. Run the benchmark with a command file set to execute only the Fourier test,
  1423. and examine the contents of the arrays. The first 100 are listed below.
  1424.  
  1425. A[i]=
  1426. 2.84 1.05 0.274 0.0824 0.0102 -0.024 -0.0426 -0.0536 -0.0605 -0.065
  1427. -0.0679 -0.0698 -0.0709 -0.0715 -0.0717 -0.0715 -0.0711 -0.0704
  1428. -0.0696 -0.0685 -0.0674 -0.0661 -0.0647 -0.0632 -0.0615 -0.0598 -0.058
  1429. -0.0561 -0.0542 -0.0521 -0.0501 -0.0479 -0.0457 -0.0434 -0.0411
  1430. -0.0387 -0.0363 -0.0338 -0.0313 -0.0288 -0.0262 -0.0236 -0.0209
  1431. -0.0183 -0.0156 -0.0129 -0.0102 -0.00744 -0.0047 -0.00196 0.000794
  1432. 0.00355 0.0063 0.00905 0.0118 0.0145 0.0172 0.0199 0.0226 0.0253
  1433. 0.0279 0.0305 0.0331 0.0357 0.0382 0.0407 0.0431 0.0455 0.0479 0.0502
  1434. 0.0525 0.0547 0.0569 0.059 0.061 0.063 0.0649 0.0668 0.0686 0.0703
  1435. 0.072 0.0736 0.0751 0.0765 0.0779 0.0792 0.0804 0.0816 0.0826 0.0836
  1436. 0.0845 0.0853 0.0861 0.0867 0.0873 0.0877 0.0881 0.0884 0.0887 0.0888
  1437.  
  1438. B[i]=
  1439. (undefined) -1.88 -1.16 -0.806 -0.61 -0.487 -0.402 -0.34 -0.293 -0.255
  1440. -0.224 -0.199 -0.177 -0.158 -0.141 -0.126 -0.113 -0.101 -0.0901
  1441. -0.0802 -0.071 -0.0625 -0.0546 -0.0473 -0.0404 -0.034 -0.0279 -0.0222
  1442. -0.0168 -0.0117 -0.00693 -0.00238 0.00193 0.00601 0.00988 0.0135 0.017
  1443. 0.0203 0.0234 0.0263 0.0291 0.0317 0.0341 0.0364 0.0385 0.0405 0.0424
  1444. 0.0441 0.0457 0.0471 0.0484 0.0496 0.0507 0.0516 0.0525 0.0532 0.0538
  1445. 0.0543 0.0546 0.0549 0.055 0.0551 0.055 0.0549 0.0546 0.0543 0.0538
  1446. 0.0533 0.0527 0.052 0.0512 0.0503 0.0493 0.0483 0.0472 0.046 0.0447
  1447. 0.0434 0.042 0.0405 0.039 0.0374 0.0358 0.0341 0.0323 0.0305 0.0287
  1448. 0.0268 0.0249 0.023 0.021 0.019 0.0169 0.0149 0.0128 0.0107 0.00857
  1449. 0.00644 0.0043 0.00215
  1450.  
  1451. Note that there is no B[0] coefficient. If the above numbers are in the
  1452. arrays shown, you can feel pretty confident that the benchmark it working
  1453. properly.
  1454.  
  1455. References
  1456.  
  1457. Engineering and Scientific Computations in Pascal, Lawrence P. Huelsman,
  1458. Harper & Row, New York, 1986.
  1459.  
  1460. Assignment Algorithm
  1461.  
  1462. Description
  1463.  
  1464. This test is built on an algorithm with direct application to the business
  1465. world. The assignment algorithm solves the following problem: Say you have X
  1466. machines and Y jobs. Any of the machines can do any of the jobs; however, the
  1467. machines are sufficiently different so that the cost of doing a particular
  1468. job can vary depending what machine does it. Furthermore, the jobs are
  1469. sufficiently different that the cost varies depending on which job a given
  1470. machine does. You therefore construct a matrix; machines are the rows, jobs
  1471. are the columns, and the [i,j] element of the array is the cost of doing the
  1472. jth job on the ith machine. How can you assign the jobs so that the cost of
  1473. completing them all is minimal? (This also assumes that one machine does one
  1474. job.)
  1475.  
  1476. Did you get that?
  1477.  
  1478. The assignment algorithm benchmark is largely a test of how well the
  1479. processor handles problems built around array manipulation. It is not a
  1480. floating-point test; the "cost matrix" built by the algorithm is simply a 2D
  1481. array of long integers. This benchmark considers an iteration to be a run of
  1482. the assignment algorithm on a 101 x 101 - element matrix. It reports its
  1483. results in iterations per second.
  1484.  
  1485. Analysis
  1486.  
  1487. Optimized 486 code (Watcom C/C++ 10.0): There are numerous loops within the
  1488. assignment algorithm. The development system we were using (Watcom C/C++
  1489. 10.0) appears to have a fine time unrolling many of them. Consequently, it
  1490. is difficult to pin down the execution impact of single lines (as in, for
  1491. example, the numeric sort benchmark).
  1492.  
  1493. On the level of functions, the benchmark spends around 70% of its time in
  1494. the routine first_assignments(). This is where a) lone zeros in rows and
  1495. columns are found and selected, and b) a choice is made between duplicate
  1496. zeros. Around 23% of the time is spent in the second_assignments() routine
  1497. where (if first_assignments() fails) the matrix is partitioned into smaller
  1498. submatrices.
  1499.  
  1500. Overall, we did a tally of instruction mix execution. The approximate
  1501. breakdowns are:
  1502.  
  1503. move - 38%
  1504.  
  1505. conditional jump - 12%
  1506.  
  1507. unconditional jump - 11%
  1508.  
  1509. comparison - 14%
  1510.  
  1511. math/logical/shift - 24%
  1512.  
  1513. Many of the move instructions that appeared to consume the most amounts of
  1514. time were referencing items on the local stack frame. This required an
  1515. indirect reference through EBP, plus a constant offset to resolve the
  1516. address.
  1517.  
  1518. This should be a good exercise of a cache, since operations in the
  1519. first_assignments() routine require both row-wise and column-wise movement
  1520. through the array. Note that the routine could be made more "severe" by
  1521. chancing the assignedtableau[][] array to an array of unsigned char --
  1522. forcing fetches on byte boundaries.
  1523.  
  1524. 680x0 Code (CodeWarrior): The CodeWarrior profiler is function-based.
  1525. Consequently, it's not possible to determine what's going on at the machine
  1526. instruction level. We can, however, get a good idea of how much time the
  1527. algorithm spends in each routine. The important routines are broken down as
  1528. follows:
  1529.  
  1530. calc_minimum_costs() - approximately 0.3% of the time
  1531.  
  1532. (250 microsecs)
  1533.  
  1534. first_assignments() - approximately 79% of the time
  1535.  
  1536. (96284.6 microsecs)
  1537.  
  1538. second_assignments() - approximately 19% of the time
  1539.  
  1540. (22758 microsecs)
  1541.  
  1542. These times are approximate; some time is spent in the Assignment() routine
  1543. itself.
  1544.  
  1545. These figures are reasonably close to those of the 486, at least in terms of
  1546. the mixture of time spent in a particular routine. Hence, this should still
  1547. be a good test of system cache (as described in the preceding section),
  1548. given the behavior of the first_assignments() routine.
  1549.  
  1550. Porting Considerations
  1551.  
  1552. The assignment algorithm test is purely an integer benchmark, and requires
  1553. no special data types that might be affected by ports to different
  1554. architectures. There are only two global constants that affect the
  1555. algorithm:
  1556.  
  1557. ASSIGNROWS and ASSIGNCOLS - These set the size of the assignment array. Both
  1558. are defined to be 101 (so, the array that is benchmarked is a 101 x 101
  1559. -element array of longs). These values should not be altered.
  1560.  
  1561. To test for correct execution of the benchmark: #define the symbol DEBUG,
  1562. recompile, set up a command file that executes only the assignment
  1563. algorithm, and run the benchmark. (You may want to pipe the output through a
  1564. paging filter, like the more program.) The act of defining DEBUG will enable
  1565. a section of code that displays the assigned columns on a per-row basis. If
  1566. the benchmark is working properly, the numbers to be displayed
  1567. should be:
  1568.  
  1569. R000: 056 R001: 066 R002: 052 R003: 065 R004: 043 R005: 023 R006: 016
  1570. R007: 077 R008: 095 R009: 004 R010: 064 R011: 076 R012: 078 R013: 091
  1571. R014: 013 R015: 029 R016: 044 R017: 014 R018: 041 R019: 042 R020: 020
  1572. R021: 071 R022: 024 R023: 017 R024: 055 R025: 040 R026: 070 R027: 025
  1573. R028: 031 R029: 019 R030: 073 R031: 002 R032: 047 R033: 009 R034: 035
  1574. R035: 045 R036: 005 R037: 063 R038: 081 R039: 039 R040: 087 R041: 008
  1575. R042: 053 R043: 093 R044: 049 R045: 092 R046: 061 R047: 046 R048: 026
  1576. R049: 034 R050: 088 R051: 000 R052: 028 R053: 018 R054: 072 R055: 021
  1577. R056: 037 R057: 082 R058: 006 R059: 058 R060: 096 R061: 068 R062: 069
  1578. R063: 054 R064: 057 R065: 086 R066: 097 R067: 084 R068: 099 R069: 051
  1579. R070: 098 R071: 003 R072: 074 R073: 062 R074: 080 R075: 033 R076: 011
  1580. R077: 094 R078: 012 R079: 050 R080: 010 R081: 038 R082: 089 R083: 059
  1581. R084: 022 R085: 079 R086: 015 R087: 007 R088: 075 R089: 083 R090: 060
  1582. R091: 048 R092: 032 R093: 067 R094: 001 R095: 030 R096: 027 R097: 085
  1583. R098: 090 R099: 036 R100: 100
  1584.  
  1585. These are the column choices for each row made by the algorithm. If
  1586. you see these numbers displayed, the algorithm is working correctly.
  1587.  
  1588. *** The original debugging information was incorrect, as it not only
  1589. *** display the chosen columns, but also displayed eliminated columns.
  1590. *** Changed to show all 101 entries. Uwe F. Mayer <[email protected]>
  1591.  
  1592. References
  1593.  
  1594. Quantitative Decision Making for Business, Gordon, Pressman, and Cohn,
  1595. Prentice-Hall, Englewood Cliffs, NJ, 1990.
  1596.  
  1597. Quantitative Decision Making, Guiseppi A. Forgionne, Wadsworth Publishing
  1598. Co., California, 1986.
  1599.  
  1600. Huffman Compression
  1601.  
  1602. Description
  1603.  
  1604. This is a compression algorithm that -- while helpful for some time as a
  1605. text compression technique -- has since fallen out of fashion on account of
  1606. the superior performance by algorithms such as LZW compression. It is,
  1607. however, still used in some graphics file formats in one form or another.
  1608.  
  1609. The benchmark consists of three parts:
  1610.  
  1611. Building a "Huffman Tree" (explained below),
  1612.  
  1613. Compression, and
  1614.  
  1615. Decompression.
  1616.  
  1617. A "Huffman Tree" is a special data structure that guides the compression and
  1618. decompression processes. If you were to diagram one, it would look like a
  1619. large binary tree (i.e., two branches per each node). Describing its
  1620. function in detail is beyond the scope of this paper (see the references for
  1621. more information). We should, however, point out that the tree is built from
  1622. the "bottom up"; and the procedure for constructing it requires that the
  1623. algorithm scan the uncompressed buffer, building a frequency table for all
  1624. the characters appearing in the buffer. (This version of the Huffman
  1625. algorithm compresses byte-at-a-time, though there's no reason why the same
  1626. principle could not be applied to tokens larger than one byte.)
  1627.  
  1628. Once the tree is built, text compression is relatively straightforward. The
  1629. algorithm fetches a character from the uncompressed buffer, navigates the
  1630. tree based on the character's value, and produces a bit stream that is
  1631. concatenated to the compressed buffer. Decompression is the reverse of that
  1632. process. (We recognize that we are simplifying the algorithm. Again, we
  1633. recommend you check the references.)
  1634.  
  1635. The Huffman Compression benchmark considers an iteration to be the three
  1636. operations described above, performed on an uncompressed text buffer of 5000
  1637. bytes. It reports its results in iterations per second.
  1638.  
  1639. Analysis
  1640.  
  1641. Optimized 486 code (Watcom C/C++ 10.0): The Huffman compression algorithm --
  1642. tree building, compression, and decompression -- is written as a single,
  1643. large routine: DoHuffIteration(). All the benchmark's time is spent within
  1644. that routine.
  1645.  
  1646. Components of DoHuffIteration() that consume the most time are those that
  1647. perform the compression and decompression .
  1648.  
  1649. The code for performing the compression spends most of its time (accounting
  1650. for about 13%) constructing the bit string for a character that is being
  1651. compressed. It does this by seeking up the tree from a leaf, emitting 1's
  1652. and 0's in the process, until it reaches the root. The stream of 1's and 0's
  1653. are loaded into a character array; the algorithm then walks "backward"
  1654. through the array, setting (or clearing) bits in the compression buffer as
  1655. it goes.
  1656.  
  1657. Similarly, the decompression portion takes about 12% of the time as the
  1658. algorithm pulls bits out of the compressed buffer -- using them to navigate
  1659. the Huffman tree -- and reconstructs the original text.
  1660.  
  1661. 680x0 Code (Macintosh CodeWarrior): CodeWarrior's profiler is function
  1662. based. Consequently, it's impossible to get performance scores for
  1663. individual machine instructions. Furthermore, as mentioned above, the
  1664. Huffman compression algorithm is written as a monolithic routine. This makes
  1665. the results from the CodeWarrior profiler all the more sparse.
  1666.  
  1667. We can at least point out that the lowmost routines (GetCompBit() and
  1668. SetCompBit()) that read and write individual bits, though called nearly 13
  1669. million times each, account for only 0.7% and 0.3% of the total time,
  1670. respectively.
  1671.  
  1672. Porting Considerations
  1673.  
  1674. The Huffman algorithm relies on no special data types. It should port
  1675. readily. Global constants of interest include:
  1676.  
  1677. EXCLUDED - This is a large, positive value. Currently it is set to 32000,
  1678. and should be left alone. Basically, this is a token that the system uses to
  1679. indicate an excluded character (one that does not appear in the plain-text).
  1680. It is set to a ridiculously high value that will never appear in the
  1681. pointers of the tree during normal construction.
  1682.  
  1683. MAXHUFFLOOPS - This is another one of those "governor" constants. The
  1684. Huffman benchmark creates more work for itself by doing multiple
  1685. compression/decompression loops. This constant sets the maximum number of
  1686. loops it will attempt per iteration before it gives up. Currently, it is set
  1687. to 50000. Though it is unlikely you'll ever need to modify this value, you
  1688. can increase it if your machine is too fast for the adjustment algorithm. Do
  1689. not reduce the number.
  1690.  
  1691. HUFFARRAYSIZE - This value sets the size of the plain-text array to be
  1692. compressed. You can override this value with the command file to see how
  1693. well your machine performs for larger or smaller arrays. The subsequent
  1694. results, however, are invalid for comparison with other systems.
  1695.  
  1696. To test for correct execution of the benchmark: #define the symbol DEBUG,
  1697. recompile, build a command file that executes only the Huffman compression
  1698. algorithm, and run the benchmark. Defining DEBUG will enable a section of
  1699. code that verifies the decompression as it takes place (i.e., the routine
  1700. compares -- character at a time -- the uncompressed data with the original
  1701. plain-text). If there's an error, the program will repeatedly display: "Error
  1702. at textoffset xxx".
  1703.  
  1704. ** If everything is correct it will emit quite a few "Huffman: OK" messages.
  1705. **
  1706. ** I added a resetting of the random number generator, outside of the
  1707. ** timed loop, and a resetting of the Huffman tree, inside of the
  1708. ** timed loop. That should help to make the benchmark more consistent.
  1709. ** The program did originally only reset half of the tree, which lead
  1710. ** to runtime errors on some systems. The effect on the benchmark
  1711. ** should be negligible, and in fact comes out as being of the order
  1712. ** of less than 1% on my test system.
  1713. ** Uwe F. Mayer <[email protected]>
  1714.  
  1715. References
  1716.  
  1717. Data Compression: Methods and Theory, James A. Storer, Computer Science
  1718. Press, Rockville, MD, 1988.
  1719.  
  1720. An Introduction to Text Processing, Peter D. Smith, MIT Press, Cambridge,
  1721. MA, 1990.
  1722.  
  1723. IDEA Encryption
  1724.  
  1725. Description
  1726.  
  1727. This is another benchmark based on a "higher-level" algorithm; "higher
  1728. -level" in the sense that it is more complex than a sort or a search
  1729. operation.
  1730.  
  1731. Security -- and, therefore, cryptography -- are becoming increasingly
  1732. important issues in the computer realm. It's likely that more and more
  1733. machines will be running routines like the IDEA encryption algorithm. (IDEA
  1734. is an acronym for the International Data Encryption Algorithm.)
  1735.  
  1736. A good description of the algorithm (and, in fact, the reference we used to
  1737. create the source code for the test) can be found in Bruce Schneier's
  1738. exhaustive exploration of encryption, "Applied Cryptography" (see
  1739. references). To quote Mr. Schneier: "In my opinion, it [IDEA] is the best
  1740. and most secure block algorithm available to the public at this time."
  1741.  
  1742. IDEA is a symmetrical, block cipher algorithm. Symmetrical means that the
  1743. same routine used to encrypt the data also decrypts the data. A block cipher
  1744. works on the plain-text (the message to be encrypted) in fixed, discrete
  1745. chunks. In the case of IDEA, the algorithm encrypts and decrypts 64 bits at
  1746. a time.
  1747.  
  1748. As pointed out in Schneier's book, there are three operations that the IDEA
  1749. uses to do its work:
  1750.  
  1751. XOR (exclusive-or)
  1752.  
  1753. Addition modulo 216 (ignoring overflow)
  1754.  
  1755. Multiplication modulo 216+1 (ignoring overflow).
  1756.  
  1757. IDEA requires a key of 128 bits. However, keys and blocks are further
  1758. subdivided into 16-bit chunks, so that any given operation within the IDEA
  1759. encryption is performed on 16-bit quantities. (This is one of the many
  1760. advantages of the algorithm, it is efficient even on 16-bit processors.)
  1761.  
  1762. The IDEA benchmark considers an "iteration" to be an encryption and
  1763. decryption of a buffer of 4000 bytes. The test actually builds 3 buffers:
  1764. The first to hold the original plain-text, the second to hold the encrypted
  1765. text, and the third to hold the decrypted text (the contents of which should
  1766. match that of the first buffer). It reports its results in iterations per
  1767. second.
  1768.  
  1769. Analysis
  1770.  
  1771. Optimized 486 code: The algorithm actually spends most of its time (nearly
  1772. 75%) within the mul() routine, which performs the multiplication modulo
  1773. 216+1. This is a super-simple routine, consisting primarily of if
  1774. statements, shifts, and additions.
  1775.  
  1776. The remaining time (around 24%) is spent in the balance of the cipher_idea()
  1777. routine. (Note that cipher_idea() calls the mul() routine frequently; so,
  1778. the 24% is comprised of the other lines of cipher_idea()). cipher_idea() is
  1779. littered with simple pointer-fetch-and-increment operations, some addition,
  1780. and some exclusive-or operations.
  1781.  
  1782. Note that IDEA's exercise of system capabilities probably doesn't extend
  1783. beyond testing simple integer math operations. Since the buffer size is set
  1784. to 4000 bytes, the test will run entirely in processor cache on most
  1785. systems. Even the cache won't get a heavy "internal" workout, since the
  1786. algorithm proceeds sequentially through each buffer from lower to higher
  1787. addresses.
  1788.  
  1789. 680x0 code (Macintosh CodeWarrior): CodeWarrior's profiler is function
  1790. based; consequently, it is impossible to determine execution profiles for
  1791. individual machine instructions. We can, however, get an idea of how much
  1792. time is spent in each routine.
  1793.  
  1794. As with Huffman compression, the IDEA algorithm is written monolithically --
  1795. a single, large routine does most of the work. However, a special
  1796. multiplication routine, mul(), is frequently called within each
  1797. encryption/decryption iteration (see above).
  1798.  
  1799. In this instance, the results for the 68K system diverges widely from those
  1800. of the 486 system. The CodeWarrior profiler shows the mul() routine as
  1801. taking only 4% of the total time in the benchmark, even though it is called
  1802. over 20 million times. The outer routine is called 600,000 times, and
  1803. accounts for about 96% of the whole program's entire time.
  1804.  
  1805. Porting Considerations
  1806.  
  1807. Since IDEA does its work in 16-bit units, it is particularly important that
  1808. u16 be defined to whatever datatype provides an unsigned 16-bit integer on
  1809. the test platform. Usually, unsigned short works for this. (You can verify
  1810. the size of a short by running the benchmarks with a command file that
  1811. includes ALLSTATS=T as one of the commands. This will cause the benchmark
  1812. program to display a message that tells the size of the int, short, and long
  1813. data-types in bytes.)
  1814.  
  1815. Also, the mul() routine in IDEA requires the u32 datatype to define an
  1816. unsigned 32-bit integer. In most cases, unsigned long works.
  1817.  
  1818. To test for correct execution of the benchmark: #define the symbol DEBUG,
  1819. recompile, build a command file that executes only the IDEA algorithm, and
  1820. run the benchmark. Defining DEBUG will enable a section of code that
  1821. compares the original plain-text with the output of the test. (Remember, the
  1822. benchmark performs both encryption and decryption.) If the algorithm has
  1823. failed, the output will not match the input, and you'll see "IDEA Error"
  1824. messages all over your display.
  1825.  
  1826. References
  1827.  
  1828. Applied Cryptography: Protocols, Algorithms, and Source Code in C, Bruce
  1829. Schneier, John Wiley & Sons, Inc., New York, 1994.
  1830.  
  1831. Neural Net
  1832.  
  1833. Description
  1834.  
  1835. The Neural Net simulation benchmark is based on a simple back-propagation
  1836. neural network presented by Maureen Caudill as part of a BYTE article that
  1837. appeared in the October, 1991 issue (see "Expert Networks" in that issue).
  1838. The network involved is a simple 3-layer (input neurodes, middle-layer
  1839. neurodes, and output neurodes) network that accepts a number of 5 x 7 input
  1840. patterns and produce a single 8-bit output pattern.
  1841.  
  1842. The test involves sending the network an input pattern that is the 5 x 7
  1843. "image" of a character (1's and 0's -- 1's representing lit pixels, 0's
  1844. representing unlit pixels), and teaching it the 8-bit ASCII code for the
  1845. character.
  1846.  
  1847. A thorough description of how the back propagation algorithm works is beyond
  1848. the scope of this paper. We recommend you search through the references
  1849. given at the end of this paper, particularly Ms. Caudill's article, for
  1850. detailed discussion. In brief, the benchmark is primarily an exercise in
  1851. floating-point operations, with some frequent use of the exp() function. It
  1852. also performs a great deal of array references, though the arrays in use are
  1853. well under 300 elements each (and less than 100 in most cases).
  1854.  
  1855. The Neural Net benchmark considers an iteration to be a single learning
  1856. cycle. (A "learning cycle" is defined as the time it takes the network to be
  1857. able to associate all input patterns to the correct output patterns within a
  1858. specified tolerance.) It reports its results in iterations per second.
  1859.  
  1860. Analysis
  1861.  
  1862. Optimized 486 code: The forward pass of the network (i.e., calculating
  1863. outputs from inputs) utilize a sigmoid function. This function has, at its
  1864. heart, a call to the exp() library routine. A small but non-negligible
  1865. amount of time is spent in that function (a little over 5% for the 486
  1866. system we tested).
  1867.  
  1868. The learning portion of the network benchmark depends on the derivative of
  1869. the sigmoid function, which turns out to require only multiplications and
  1870. subtractions. Consequently, each learning pass exercises only simple
  1871. floating-point operations.
  1872.  
  1873. If we divide the time spent in the test into two parts -- forward pass and
  1874. backward pass (the latter being the learning pass) -- then the test appears
  1875. to spend the greatest part of its time in the learning phase. In fact, most
  1876. time is spent in the adjust_mid_wts() routine. This is the part of the
  1877. routine that alters the weights on the middle layer neurodes. (It accounts
  1878. for over 40% of the benchmark's time.)
  1879.  
  1880. 680x0 Code (Macintosh CodeWarrior): Though CodeWarrior's profiler is
  1881. function based, the neural net benchmark is highly modular. We can therefore
  1882. get a good breakdown of routine usage:
  1883.  
  1884. worst_pass_error() - 304 microsecs (called 4680 times)
  1885.  
  1886. adjust_mid_wts() - 83277 microsecs (called 46800 times)
  1887.  
  1888. adjust_out_wts() - 17394 microsecs (called 46800 times)
  1889.  
  1890. do_mid_error() - 11512 microsecs (called 46800 times)
  1891.  
  1892. do_out_error() - 3002 microsecs (called 46800 times)
  1893.  
  1894. do_mid_forward() - 49559 microsecs (called 46800 times)
  1895.  
  1896. do_out_forward() - 20634 microsecs (called 46800 times)
  1897.  
  1898. Again, most time was spent in adjust_mid_wts() (as on the 486), accounting
  1899. for almost twice as much time as do_mid_forward().
  1900.  
  1901. Porting Consideration
  1902.  
  1903. The Neural Net benchmark is not dependent on any special data types. There
  1904. are a number of global variables and arrays that should not be altered in
  1905. any way. Most importantly, the #defines found in NBENCH1.H under the Neural
  1906. Net section should not be changed. These control not only the number of
  1907. neurodes in each layer; they also include constants that govern the learning
  1908. processes.
  1909.  
  1910. Other globals to be aware of:
  1911.  
  1912. MAXNNETLOOPS - This constant simply sets the upper limit on the number of
  1913. training loops the test will permit per iteration. The Neural Net benchmark
  1914. adjusts its workload by re-teaching itself over and over (each time it
  1915. begins a new training session, the network is "cleared" -- loaded with
  1916. random values). It is unlikely you will ever need to modify this constant.
  1917.  
  1918. inpath - This string pointer is set to the path from which the neural net's
  1919. input data is read. It is currently hardwired to "NNET.DAT". You shouldn't
  1920. have to change this name, unless your file system requires directory
  1921. information as part of the path.
  1922.  
  1923. Note that the Neural Net benchmark is the only test that requires an
  1924. external data file. The contents of the file are listed in an attachment to
  1925. this paper. You should use the attachment to reconstruct the file should it
  1926. become lost or corrupted. Any changes to the file will invalidate the test
  1927. results.
  1928.  
  1929. To test for correct execution of the benchmark: #define the symbol DEBUG,
  1930. recompile, build a command file that executes only the Neural Net test, and
  1931. run the benchmark. Defining DEBUG will enable a section of code that
  1932. displays how many passes through the learning process were required for the
  1933. net to learn. It should learn in 780 passes.
  1934.  
  1935. References
  1936.  
  1937. "Expert Networks," Maureen Caudill, BYTE Magazine, October, 1991.
  1938.  
  1939. Simulating Neural Networks, Norbert Hoffmann, Verlag Vieweg, Wiesbaden,
  1940. 1994.
  1941.  
  1942. Signal and Image Processing with Neural Networks, Timothy Masters, John
  1943. Wiley and Sons, New York, 1994.
  1944.  
  1945. Introduction to Neural Networks, Jeannette Stanley, California Scientific
  1946. Software, CA, 1989.
  1947.  
  1948. LU Decomposition
  1949.  
  1950. Description
  1951.  
  1952. LU Decomposition is an algorithm that can be used as the heart of a program
  1953. for solving linear equations. Suppose you have a matrix A. LU Decomposition
  1954. determines the matrices L and U such that
  1955.  
  1956. L . U = A
  1957.  
  1958. where L is a lower triangular matrix and U is an upper triangular matrix. (A
  1959. lower triangular matrix has nonzero elements only on the main diagonal and
  1960. below. An upper triangular matrix has nonzero elements only on the main
  1961. diagonal and above.)
  1962.  
  1963. Without going into the mathematical details too deeply, having the L and U
  1964. matrices makes the solution of linear equations (i.e., equations of the form
  1965. A . x = b) quite easy. It turns out that you can also use LU decomposition
  1966. to determine matrix inverses and determinants.
  1967.  
  1968. The algorithm used in the benchmarks was derived from Numerical Recipes in
  1969. Pascal (there is a C version of the book, which we did not have on hand), a
  1970. book we heartily recommend to anyone serious about mathematical and
  1971. scientific computing. The authors are approving of LU decomposition as a
  1972. means of solving linear equations, pointing out that their version (which
  1973. makes use of what we would have to call "Crout's method with partial
  1974. implicit pivoting") is a factor of 3 better than one of their Gauss-Jordan
  1975. routines, a factor of 1.5 better than another. They go on to demonstrate the
  1976. use of LU decomposition for iterative improvement of linear equation
  1977. solutions.
  1978.  
  1979. The benchmark begins by creating a "solvable" linear system. This is easily
  1980. done by loading up the column vector b with random integers, then
  1981. initializing A with an identity matrix. The equations are then "scrambled"
  1982. by either multiplying a row by a constant, or adding one row to another. The
  1983. scrambled matrices are handed to the LU algorithm.
  1984.  
  1985. The LU Decomposition benchmark considers a single iteration to be the
  1986. solution of one set of equations (the size of A is fixed at 101 x 101
  1987. elements). It reports its results in iterations per second.
  1988.  
  1989. Analysis
  1990.  
  1991. Optimized 486 code (Watcom C/C++ 10.0): The entire algorithm consists of two
  1992. parts: the LU decomposition itself, and the back substitution algorithm that
  1993. builds the solution vector. The majority of the algorithm's time takes place
  1994. within the former; the algorithm that builds the L and U matrices (this
  1995. takes place in routine ludcmp()).
  1996.  
  1997. Within ludcmp(), there are two extremely tight for loops forming the heart
  1998. of Crout's algorithm that consume the majority of the time. The loops are
  1999. "tight" in that they each consist of only one line of code; in both cases,
  2000. the line of code is a "multiply and accumulate" operation (actually, it's
  2001. sort of a multiply and de-accumulate, since the result of the multiplication
  2002. is subtracted, not added).
  2003.  
  2004. In both cases, the items multiplied are elements from the A array; and one
  2005. factor's row index is varying more rapidly, while another factor's column
  2006. index is varying more rapidly.
  2007.  
  2008. Note that this is a good overall test of floating-point operations within
  2009. matrices. Most of the math is floating-point; primarily additions,
  2010. subtractions, and multiplications (only a few divisions).
  2011.  
  2012. 680x0 Code (Macintosh CodeWarrior): CodeWarrior's profiler is function
  2013. based. It is therefore impossible to determine execution profiles at the
  2014. machine-code level. The profiler does, however, allow us to determine how
  2015. much time the benchmark spends in each routine. This breakdown is as
  2016. follows:
  2017.  
  2018. lusolve() - 3.4 microsecs (about 0% of the time)
  2019.  
  2020. lubksb() 1198 microsec (about 2% of the time)
  2021.  
  2022. ludcmp() - 63171 microsec (about 91% of the time)
  2023.  
  2024. The above percentages are for the whole program. Consequently, as a portion
  2025. of actual benchmark time, the amount attributed to each will be slightly
  2026. larger (though the proportions will remain the same).
  2027.  
  2028. Since ludcmp() performs the actual LU decomposition, this is exactly where
  2029. we'd want the benchmark to spend its time. The lubksb() routine calls
  2030. ludcmp(), using the resulting matrix to "back-solve" the linear equation.
  2031.  
  2032. Porting Considerations
  2033.  
  2034. The LU Decomposition routine requires no special data types, and is immune
  2035. to byte ordering. It does make use of a typedef (LUdblptr) that includes an
  2036. embedded union; this allows the benchmark to "coerce" a pointer to double
  2037. into a pointer to a 2D array of double. This arrangement has not caused
  2038. problems with the compilers we have tested to date.
  2039.  
  2040. Other constants and globals to be aware of:
  2041.  
  2042. LUARRAYROWS and LUARRAYCOLS - These constants set the size of the
  2043. coefficient matrix, A. They cannot be altered by command file. In fact, you
  2044. shouldn't alter them at all, or your results will be invalid. Currently,
  2045. they are both set to 101.
  2046.  
  2047. MAXLUARRAYS - This is another "governor" constant. The algorithm performs
  2048. dynamic workload adjustment by building more and more arrays to solve per
  2049. timing round. This sets the maximum upper limit of arrays that it will
  2050. build. Currently, it is set to 1000, which should be more than enough for
  2051. the reasonable future (1000 arrays of 101 x 101 floating-point doubles would
  2052. require somewhere around 80 megabytes of RAM -- and that's not counting the
  2053. column vectors).
  2054.  
  2055. To test for correct execution of the benchmark: Currently, there is no
  2056. simple technique for doing this. You can, however, either use your favorite
  2057. debugger (or embed a printf() statement) at the conclusion of the lubksb()
  2058. routine. When this routine concludes, the array b will hold the solution
  2059. vector. These items will be stored as floating-point doubles, and the first
  2060. 14 are (with rounding):
  2061.  
  2062. 46 20 23 22 85 86 97 95 8 89 75 67 6 86
  2063.  
  2064. If you find these numbers as the first 14 in the array b[], then you're
  2065. virtually guaranteed that the algorithm is working correctly.
  2066.  
  2067. *** The above is not correct, as the initial matrix is not the identity,
  2068. *** but a matrix with random nonzero entries on the diagonal (they have
  2069. *** altered the algorithm since they wrote the documentation).
  2070. *** I changed the output of the debugging routine, it now prints first
  2071. *** what the array b should hold (as righthand side divided by diagonal
  2072. *** entry), and then it prints what the array b does hold after the
  2073. *** decomposition has been done to compute the solution of the system. If
  2074. *** you get the same, then fine.
  2075. *** And, by the way, my original right hand sides are
  2076. *** 46 23 85 97 8 75 6 81 88 76 6 84 31 53 2 ...
  2077. *** and the diagonal entries are
  2078. *** 520 922 186 495 89 267 786 571 175 600 738 321 897 541 859 ...
  2079. *** You notice that one has every other number of the original sequence.
  2080. *** This is due to BYTE's change of the algorithm, as they now also use the
  2081. *** random number generator to generate the diagonal elements.
  2082. *** Here is the complete set of data:
  2083. *** 46/520=0.09 23/922=0.02 85/186=0.46 97/495=0.20 8/89=0.09
  2084. *** 75/267=0.28 6/786=0.01 81/571=0.14 88/175=0.50 76/600=0.13
  2085. *** 6/738=0.01 84/321=0.26 31/897=0.03 53/541=0.10 2/859=0.00
  2086. *** 86/92=0.93 51/121=0.42 29/248=0.12 51/789=0.06 84/6=14.00
  2087. *** 21/180=0.12 33/48=0.69 2/899=0.00 12/820=0.01 69/372=0.19
  2088. *** 59/809=0.07 74/18=4.11 40/788=0.05 39/56=0.70 86/91=0.95
  2089. *** 33/878=0.04 82/165=0.50 42/561=0.07 8/274=0.03 84/694=0.12
  2090. *** 32/352=0.09 25/969=0.03 59/816=0.07 33/112=0.29 5/125=0.04
  2091. *** 89/740=0.12 7/223=0.03 54/994=0.05 33/80=0.41 55/676=0.08
  2092. *** 6/524=0.01 36/544=0.07 21/160=0.13 58/596=0.10 15/717=0.02
  2093. *** 84/311=0.27 98/530=0.18 46/713=0.06 41/233=0.18 73/640=0.11
  2094. *** 40/343=0.12 72/586=0.12 100/965=0.10 59/764=0.08 37/866=0.04
  2095. *** 27/682=0.04 3/652=0.00 41/352=0.12 87/786=0.11 45/79=0.57
  2096. *** 83/761=0.11 41/817=0.05 46/209=0.22 78/930=0.08 85/210=0.40
  2097. *** 80/756=0.11 18/931=0.02 30/669=0.04 47/127=0.37 85/891=0.10
  2098. *** 66/364=0.18 83/955=0.09 58/637=0.09 58/778=0.07 82/288=0.28
  2099. *** 42/540=0.08 76/290=0.26 59/36=1.64 29/463=0.06 63/476=0.13
  2100. *** 6/340=0.02 73/341=0.21 59/737=0.08 81/492=0.16 98/443=0.22
  2101. *** 58/32=1.81 53/562=0.09 54/263=0.21 46/367=0.13 58/390=0.15
  2102. *** 96/845=0.11 30/746=0.04 2/687=0.00 28/849=0.03 84/180=0.47
  2103. *** 85/382=0.22
  2104. *** Uwe F. Mayer <[email protected]>
  2105.  
  2106. References
  2107.  
  2108. Numerical Recipes in Pascal: The Art of Scientific Computing, Press,
  2109. Flannery, Teukolsky, Vetterling, Cambridge University Press, New York, 1989.
Advertisement
Add Comment
Please, Sign In to add comment