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

  1. Path: sparky!uunet!sun-barr!olivea!spool.mu.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!cpsc.ucalgary.ca!cleary
  2. From: cleary@cpsc.ucalgary.ca (John Cleary)
  3. Newsgroups: comp.arch
  4. Subject: Re: integer distance or sqrt
  5. Summary: using table look-up helps
  6. Message-ID: <Bxw6qM.Msw@cpsc.ucalgary.ca>
  7. Date: 18 Nov 92 03:23:10 GMT
  8. References: <55F0TB1w165w@tsoft.sf-bay.org> <CLIFFC.92Nov15184340@miranda.rice.edu>
  9. Sender: news@cpsc.ucalgary.ca (News Manager)
  10. Organization: University of Calgary Computer Science
  11. Lines: 22
  12.  
  13. >bbs.dennis@tsoft.sf-bay.org (Dennis Yelle) writes:
  14. >> I first considered asking for a integer sqrt, but maybe if the context is
  15. >> known a better answer can be given.  This program is normally run on a
  16. >> machine with no floating point hardware so I would like to get rid of
  17. >> floats entirely.
  18. >
  19. >I sent him an integer square root code using Newton's Method.  I've done
  20. >this problem before and I'm sure there are better methods out there.  Does
  21. >somebody want to post/email something better than Newton's?
  22. >
  23. >Thanx,
  24. >Cliff
  25.  
  26. Here at Calgary some years ago Geoff Wyvill greatly spedup the
  27. 'C" sqrt function on a Sun/3 by doing a table lookup on the high-order
  28. 16(approx) bits and then doing a single Newtons step.  This ran roughly
  29. 10 times faster than the standard one (less code too!!).  I presume
  30. that a similar trick would work in this case.
  31. -- 
  32. John Cleary
  33. University of Calgary.
  34. cleary@cpsc.ucalgary.ca
  35.