Xref: utzoo comp.lang.smalltalk:3053 comp.object:3658 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!munnari.oz.au!metro!extro!objtch From: objtch@extro.ucc.su.OZ.AU (Peter Goodall) Newsgroups: comp.lang.smalltalk,comp.object Subject: Re: Integer / Float arithmetic in ST80 (Some benchmarks) Message-ID: Date: 6 Jun 91 23:07:35 GMT Article-I.D.: extro.objtch.676249655 References: <1991Jun5.185120.8104@bqnes74.bnr.ca> Sender: news@metro.ucc.su.OZ.AU Organization: Sydney University Computing Service, Sydney, NSW, Australia Lines: 66 Nntp-Posting-Host: extro.ucc.su.oz.au CWatts@BNR.CA (Carl Watts) writes: And thanks very much for the discussion. >In regards to the "Re: Integer / Float arithmetic in ST80 (Some benchmarks)" message I posted a while ago, "Ed Klimas" sent me a response through normal mail. Because the message and my response are of general userfulness to Smalltalkers, I'll post my answer here (hope you don't mind Ed?) [stuff deleted] >You definitely want: >| a | >a := 1. >2499 timesRepeat: [a := (a*a) sqrt ln exp arcTan tan + 1] >I found it very interesting that you reported that Smalltalk/V answered the precise answer "2500" for the final value of "a" with the code you gave above. This shows that either Smalltalk/V is using incredibly precise trig arithmetic OR that you got the answer "2500" only because of the aforementioned bugs in the Smalltalk implementation. Only because of these bugs could your expression happen to have given you the right answer. >I suspect if you redo your benchmark test using my version of this Savage Benchmark, you will find: >a) Smalltalk/V does not have incredibly precise trig arithmetic, it was just a bizarre coincidence that bugs in your expression made use of bugs in the Smalltalk to give you the impression that it did. >b) The times you gave for Smalltalk-80 v2.5 were off by about 50% because the loop only executed half the expected number of times. >Please get back to us about Smalltalk/V's precision. I would be very interested to find out how Smalltalk/V fares in precision to Smalltalk-80 for a properly formulated expression of this benchmark. Here are some interesting results using Smalltalk/V Windows: |a| 1 to: 9 do: [ :a | a := a + 100]. ^a gives the answer: 102 | a | a := 1. 2499 timesRepeat: [a := (a*a) sqrt ln exp arcTan tan + 1]. ^a answers: 2500.0 I executed the first expression in the debugger and was reminded that I had seen the variable 'to:' materialize in this situation before. An artifact of optimisation? Note that I am not using the maths processor, and therefore the aritmetic routines should be from the floating point emulation DLL, which has C source code which from memory is the usual arithmetic out of the Microsoft C library. I also executed the following to elminate the looping, and just see the arithmetic results: | a | a := 9999. a := (a*a) sqrt ln exp arcTan tan + 1. ^a answers: 10000.0 Comments please! I am amazed at the very first of my results. -- Peter Goodall - Smalltalk Systems Consultant - objtch@extro.ucc.su.oz.au ObjecTech Pty. Ltd. - Software Tools, Training, and Advice 162 Burns Bay Rd, LANE COVE, NSW, AUSTRALIA. - Phone/Fax: +61 2 418-7433