home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10776 < prev    next >
Encoding:
Text File  |  1992-11-15  |  1.9 KB  |  48 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!sigyn.idt.unit.no!renebi
  3. From: renebi@idt.unit.no (Olaf Rene Birkeland)
  4. Subject: Re: integer distance or sqrt
  5. Message-ID: <1992Nov16.105623.27220@ugle.unit.no>
  6. Sender: news@ugle.unit.no (NetNews Administrator)
  7. Reply-To: renebi@idt.unit.no
  8. Organization: The Norwegian Institute of Technology
  9. References: <55F0TB1w165w@tsoft.sf-bay.org> <CLIFFC.92Nov15184340@miranda.rice.edu>
  10. Date: Mon, 16 Nov 92 10:56:23 GMT
  11. Lines: 35
  12.  
  13. In article <CLIFFC.92Nov15184340@miranda.rice.edu>, cliffc@rice.edu (Cliff Click) writes:
  14. |> bbs.dennis@tsoft.sf-bay.org (Dennis Yelle) writes:
  15. |> > because of the interest in Herman Rubin's optimization problems
  16. |> > some people here might be interested in this.
  17. |> > It is a real problem.  That is, I have a program that spends quite a 
  18. |> > lot of time here, and I would like to change this if I could.  
  19. |> 
  20. |> > I first considered asking for a integer sqrt, but maybe if the context is 
  21. |> > known a better answer can be given.  This program is normally run on a 
  22. |> > machine with no floating point hardware so I would like to get rid of 
  23. |> > floats entirely.
  24. |> 
  25. |> I sent him an integer square root code using Newton's Method.  I've done 
  26. |> this problem before and I'm sure there are better methods out there.  Does 
  27. |> somebody want to post/email something better than Newton's?
  28.  
  29. I don't know the details of your algorithm, but wouldn't it be
  30. possible to avoid sqrt's, i.e. do the substitutions
  31.  
  32.   sqrt(x^2 + y^2) < sqrt (z^2+t^2)    => (x^2+y^2) < (z^2+y^2)
  33.   sqrt(x^2 + y^2) < d                 => (x^2+y^2) < d^2
  34.  
  35. and so on? This demands larger integers, but that might be needed
  36. anyway for temporary calculations?
  37.  
  38. - Olaf RenΘ 
  39.  
  40. --------------------------------------------------------------
  41. Olaf RenΘ Birkeland                 e-mail: renebi@idt.unit.no
  42. The Norwegian Institute of Technology, University of Trondheim
  43. --------------------------------------------------------------
  44.  
  45.  
  46.  
  47.  
  48.