Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.scheme
From: scottw@bmtech.demon.co.uk (Scott Wheeler)
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!gatech!swrinde!pipex!peernews.demon.co.uk!bmtech.demon.co.uk!scottw
Followup-To: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.scheme
Reply-To: Scott Wheeler <scottw@bmtech.demon.co.uk>
Subject: Re: Which first-course languages? (was: What schools use Eiffel (was: No top schools use Ada)) ?
Organization: British Maritime Technology
References: <3mq0jd$r10@kaiwan009.kaiwan.com> <NEWTNews.27781.798049024.ir001168@cec-services-01> <3mrg2c$onn@disunms.epfl.ch> <tomkwongD76x5L.AED@netcom.com> <3n33ej$2h7@theopolis.orl.mmc.com> <3n35ja$6u3@theopolis.orl.mmc.com> <jyaxda@bmtech.demon.co
X-Posting-Host: bmtech.demon.co.uk
Date: Tue, 25 Apr 1995 17:41:14 +0000
Message-ID: <jycahg@bmtech.demon.co.uk>
Sender: usenet@demon.co.uk
Lines: 22
Xref: glinda.oz.cs.cmu.edu comp.lang.eiffel:8396 comp.lang.ada:29139 comp.edu:12220 comp.lang.scheme:12560

<jybfxn@bmtech.demon.co.uk> <dewar.798688839@gnat>
X-Newsreader: NewsBase v1.36 (Beta)
Lines: 18

In Article <dewar.798688839@gnat> Robert Dewar writes:
>>Scott says that it may still be appropriate to use an epsilon in a 
Newton Raphson square root? I am interested? why? I don't see the need, 
and of course it slows down the iteration by perhaps a factor of two 
(rememebr that comparisons are as expensive as multiplications and 
additions).

The main reason is to reduce the number of iterations. Portability 
might also be an issue, as not all enivronments use a standard floating 
point representation (SANE on the Macs, and the old Microcruft FP 
standard spring to mind), and it is fairly common to find a compiler 
that will switch representations according to a compiler flag. However 
I don't think it's very important. By the way, you're wrong about the 
iteration time: an Intel 386 working with 32-bit registers takes 9-38 
cycles for a MUL, and 2 cycles for a CMP - this is assuming the 
higher-level language maps directly to the obvious instructions.

Scott
