home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10823 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.7 KB

  1. Path: sparky!uunet!pmafire!mica.inel.gov!ux1!news.byu.edu!hamblin.math.byu.edu!sol.ctr.columbia.edu!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!netnews.upenn.edu!netnews.noc.drexel.edu!king.mcs.drexel.edu!dmagagno
  2. From: dmagagno@mcs.drexel.edu (David Magagnosc)
  3. Newsgroups: comp.arch
  4. Subject: Re: integer distance or sqrt
  5. Message-ID: <1992Nov17.143914.19700@mcs.drexel.edu>
  6. Date: 17 Nov 92 14:39:14 GMT
  7. References: <55F0TB1w165w@tsoft.sf-bay.org> <CLIFFC.92Nov15184340@miranda.rice.edu> <MOSS.92Nov16094710@CRAFTY.cs.cmu.edu>
  8. Organization: Drexel University
  9. Lines: 24
  10.  
  11. This reminds me of something I came up with not long after the
  12. Midatlantic ACM Region Programming Contest last year.  One of the
  13. problems involved computing square roots by the long division-like
  14. method (which they claimed we all learned in elementary school).
  15. I translated it to binary, applied the techniques used for division,
  16. and came up with a sort of non-restoring square root.
  17.  
  18. Now, the convergence is linear (2 bits of input for 1 bit of output
  19. per iteration), but it uses only elementary operations like shifts
  20. and adds, so its run time should be comparable to a single division.
  21. Newton's method, on the other hand, typically uses division on
  22. every iteration.
  23.  
  24. So, the real question is, has someone done something like this before?
  25. How does it really compare for smallish (under 32 or maybe even 64
  26. bit) square roots?
  27.  
  28. Oh yes, it can also be extended very easily to compute fixed point
  29. square roots of integers -- as many bits as you like.
  30.  
  31. D. Magagnosc
  32. -- 
  33. 496620796F752063616E207265616420746869732C20796F752063616E206265636F6D65206120
  34. 636F6D70757465722070726F6772616D6D657220616E6420676574206120676F6F64206A6F622E
  35.