home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.smalltalk
- Path: sparky!uunet!cs.utexas.edu!news.uta.edu!utafll!bruce
- From: bruce@utafll.uta.edu (Bruce Samuelson)
- Subject: Slopstone/Smopstone bugs
- Message-ID: <1993Jan23.002443.11226@utagraph.uta.edu>
- Sender: news@utagraph.uta.edu (USENET News System)
- Nntp-Posting-Host: utafll.uta.edu
- Organization: University of Texas at Arlington
- Date: Sat, 23 Jan 1993 00:24:43 GMT
- Lines: 90
-
- Summary: There were some minor bugs in Slopstones and Smopstones, mostly in
- documentation and terminology. They are easily corrected, and by a stroke of
- luck, none of the numeric results that have been posted are affected. New
- fileins with bugs corrected are posted separately.
-
- -----------------------------------------------------------------------------
- 1) Computation of mean
- -----------------------------------------------------------------------------
-
- Slopstone>>readme
- Slopstone>>execute
- Smopstone>>readme
- Smopstone>>execute
-
- The benchmarks calculate the geometric mean but erroneously refer to it as
- harmonic mean. Thanks to Urs Hoelzle for pointing this out. Three popular
- means are arithmetic, harmonic, and geometric. Since geometric is least
- sensitive to widely differing component values, and scales better than
- harmonic mean, let's stick with it. The ParcPlace Dorado benchmarks happen to
- use harmonic mean. According to a textbook of mine, the definitions are
-
- arithmetic mean = (x1+x2...+xn)/n
- harmonic mean = n/((1/x1)+(1/x2)...+(1/xn))
- geometric mean = (x1*x2...*xn)**(1/n)
-
- Rather than use this formula for geometric mean, I used an equivalent formula
- to avoid floating point overflow in ST/V-DOS:
-
- geometric mean = (x1**(1/n))*(x2**(1/n))*...*(xn**(1/n))
-
- Significance of the bug: posted numbers are correct but results should read
- 'geometric mean.'
-
- -----------------------------------------------------------------------------
- 2) Rectangle intersection in Smopstone>>sorcercersApprentice
- -----------------------------------------------------------------------------
-
- change (r1 origin ~= r2 origin and: [r1 corner ~= r2 corner])
- to (r1 origin ~= r2 origin or: [r1 corner ~= r2 corner])
-
- This test was supposed to be equivalent to r1 ~= r2.
-
- Significance of the bug: In theory, the error could make the benchmark
- converge slightly faster than it would have otherwise. In practice, for the
- numeric parameters chosen, the error has no effect at all.
-
- -----------------------------------------------------------------------------
- 3) Comment and error message in Smopstone>>primesUpTo:
- -----------------------------------------------------------------------------
-
- change "Return the prime numbers between 1 and n."
- to "Return the prime numbers between 2 and n."
-
- change 'Upper limit out of range.'
- to 'Prime limit(s) out of range.'
-
- Significance of the bug: the comment and error message weren't quite accurate.
-
- -----------------------------------------------------------------------------
- 4) Variances of Float>>printString in Smopstone>>streamTestsOn:
- -----------------------------------------------------------------------------
-
- Some European versions of Smalltalk use commas when printing floats, while USA
- versions use decimal points. Marten Feldtmann pointed this out. See the code
- for details.
-
- Significance of the bug: it can be fixed in a portable manner that doesn't
- affect performance. In my consolidated benchmark tables, I'll use decimal
- point for uniformity.
-
- -----------------------------------------------------------------------------
- 5) Luck of the draw in SmopstoneBenchmark>>streamTestsOn:
- -----------------------------------------------------------------------------
-
- The final test for integers = floats works because it so happens that both are
- OrderedCollections. If integers had been an Array, for instance, it wouldn't
- have worked. In other words, for example, Array with: 1 does not equal
- OrderedCollection with: 1 in Smalltalk. However, OrderedCollection with: 1
- does equal OrderedCollection with: 1.0. I don't want to coerce both to the
- same kind of collection in this method, because it would make this test run
- slightly longer. I could do the coersion in SmopstoneBenchmark>>setup, but
- I'll just leave things be.
-
- Significance of the bug: none, unless the '=' selector is redefined in future
- versions of Smalltalk.
- --
- **********************************************************
- * Bruce Samuelson Department of Linguistics *
- * bruce@ling.uta.edu University of Texas at Arlington *
- **********************************************************
-