🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #11434

Re: integer distance or sqrt

#11434
From: Robert Bernecky
Date: Fri, 20 Nov 1992 15:17
39 lines
2107 bytes
In article <1992Nov16.110102.17077@imada.ou.dk> breese@monet.imada.ou.dk (Bjoern Reese) writes:
>In article <CLIFFC.92Nov15184340@miranda.rice.edu> cliffc@rice.edu (Cliff  
>Click) writes:
>> bbs.dennis@tsoft.sf-bay.org (Dennis Yelle) writes:
>
>I found it some years ago in a german magazine called "MC."
>It was dubbed "Heron's Algorithm." As you can see it is a
>16 bit implementation. Does anybody have further information
>about this algorithm? (like, how to extend it to 32 bits.)

This from ACM SIGAPL Quote Quad, Vol 16, no 4, 1986, from
"A Perfect Square Root Routine", by E.E. McDonnell:

"Heron, the Alexandrian scientist (possibly as early as the
second century B.C or as late as the third century A.D.) devised
a method for approximating square roots which is still in use today.
The method is an iterative one, and exploits the fact that any
particular estimate Y of the value of the square root R of a positive
number X, if it is not equal to R, may be improved by computing the
average of Y and X divided by Y, that is:
   Y =. (Y +  X%Y) %2

If the estimate Y is positive, the method will eventually converge to
the square root. ... The closer the initial estimate Y is to the eventual
root, the fewer will be the number of iterations required. Much has
been written on the subject of choosing best estimates... "

(And he goes on to describe how he did it for SHARP APL).

Bob




Robert Bernecky      rbe@yrloc.ipsa.reuter.com  bernecky@itrchq.itrc.on.ca 
Snake Island Research Inc  (416) 368-6944   FAX: (416) 360-4694 
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9 
Canada
Technical Details
Message-ID: <1992Nov20.151757.3391@yrloc.ipsa.reuter.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!geac!itcyyz!yrloc!rbe
References: <CLIFFC.92Nov15184340@miranda.rice.edu> <1992Nov16.110102.17077@imada.ou.dk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.arch
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!geac!itcyyz!yrloc!rbe
From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Subject: Re: integer distance or sqrt
Message-ID: <1992Nov20.151757.3391@yrloc.ipsa.reuter.COM>
Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Organization: Snake Island Research Inc, Toronto
References: <CLIFFC.92Nov15184340@miranda.rice.edu> <1992Nov16.110102.17077@imada.ou.dk>
Date: Fri, 20 Nov 92 15:17:57 GMT
Lines: 39