Received: (from major@localhost)
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) id KAA01382
	for pups-liszt; Tue, 7 Apr 1998 10:43:25 +1000 (EST)
X-Authentication-Warning: minnie.cs.adfa.oz.au: major set sender to owner-pups@minnie.cs.adfa.oz.au using -f
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) with ESMTP id KAA01367
	for <pups@minnie.cs.adfa.oz.au>; Tue, 7 Apr 1998 10:43:10 +1000 (EST)
Received: from goppelt.op.net (d-phlarc1-0c.ppp.op.net [209.152.199.76]) by renoir.op.net (o1/$Revision: 1.15 $) with SMTP id UAA07198; Mon, 6 Apr 1998 20:42:56 -0400 (EDT)
Message-Id: <199804070042.UAA07198@renoir.op.net>
Comments: Authenticated sender is <edgee@cyberpass.net>
From: "Ed G." <edgee@cyberpass.net>
To: pups@minnie.cs.adfa.oz.au, Bob Supnik <Bob.Supnik@digital.com>
Date: Mon, 6 Apr 1998 20:42:54 -0400
MIME-Version: 1.0
Content-type: Multipart/Mixed; boundary=Message-Boundary-396
Subject: Floating Point Bug in Bob's Emulator
Reply-to: edgee@cyberpass.net
X-mailer: Pegasus Mail for Win32 (v2.54)
Sender: owner-pups@minnie.cs.adfa.oz.au
Precedence: bulk


--Message-Boundary-396
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

I wrote a little square root program in "C" to test the floating
point in Bob Supnik's emulator (see attached code).  The program
works fine under Linux, but bombs on Bob's emulator, confirming
people's theory that the emulator has a floating point bug. 

I used Newton's method for the algorithm and only uses add,
subtract, multiply and divide.  The emulator produced identical
incorrect results for two different versions of the program one using
floats, the other doubles.

Here's what the program does on Bob Supnik's emulator:

# cc mysqrt.c
# a.out
Initial guess: 85070586659632214000000000000000000000.0000000000000000

guess: 1.0000000000000000
guess: 85070586659632214000000000000000000000.0000000000000000
guess: 1.0000000000000000
guess: 85070586659632214000000000000000000000.0000000000000000
guess: 1.0000000000000000
guess: 85070586659632214000000000000000000000.0000000000000000
guess: 1.0000000000000000

Here's what the program does on Linux:

[root@oskar uv7]# gcc mysqrt.c 
[root@oskar uv7]# a.out
Initial guess: 1.0000000000000000

guess: 1.5000000000000000
guess: 1.4166666666666667
guess: 1.4142156862745099
guess: 1.4142135623746899

My square root is: 1.4142135623746899


--Message-Boundary-396
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  MYSQRT.C
     Date:  6 Apr 1998, 23:50
     Size:  413 bytes.
     Type:  Program-source

--Message-Boundary-396
Content-type: Application/Octet-stream; name="MYSQRT.C"; type=Program-source
Content-disposition: attachment; filename="MYSQRT.C"
Content-transfer-encoding: BASE64

I2RlZmluZSBQUkUgZG91YmxlCgpQUkUgYWJzdihuKQogIFBSRSBuOwp7CiAgaWYgKG4gPCAw
KSB7CiAgICByZXR1cm4gLW47CiAgfQogIGVsc2UgewogICAgcmV0dXJuIG47CiAgfQp9CgpQ
UkUgbXlzcXJ0KG4pClBSRSBuOwp7ClBSRSBnLCBlcnI7CgpnID0gbi8yOwplcnIgPSBuLzFl
NjsKCnByaW50ZigiUHJlY2lzaW9uOiAgUFJFXG4iKTsKCnByaW50ZigiSW5pdGlhbCBndWVz
czogJS4xNmZcblxuIiwgZyk7CiB3aGlsZSAoYWJzdihnKmctbikgPj0gZXJyKSB7CiAgIGcg
PSAoZypnK24pLygyKmcpOwogICBwcmludGYoImd1ZXNzOiAlLjE2ZlxuIiwgZyk7CiB9CnJl
dHVybihnKTsKfQoKbWFpbigpCnsKUFJFIG4gPSAyLjA7CgogcHJpbnRmKCJcbk15IHNxdWFy
ZSByb290IGlzOiAlLjE2ZlxuIiwgbXlzcXJ0KG4pKTsKfQo=

--Message-Boundary-396--

