home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2055 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.5 KB

  1. Path: sparky!uunet!mcsun!uknet!icdoc!sot-ecs!jjh91r
  2. From: jjh91r@ecs.soton.ac.uk (Jon. Hallett)
  3. Newsgroups: comp.programming
  4. Subject: Re: Calculating a cube root
  5. Message-ID: <JJH91R.92Jul22102552@louis.ecs.soton.ac.uk>
  6. Date: 22 Jul 92 09:25:52 GMT
  7. References: <l624kmINN29e@girtab.usc.edu> <129360001@hpfcso.FC.HP.COM>
  8.     <1992Jul20.123722.27958@cs.ruu.nl>
  9.     <1992Jul20.160255.17562@organpipe.uug.arizona.edu>
  10.     <1992Jul21.085023.11890@cs.ruu.nl>
  11. Sender: news@ecs.soton.ac.uk
  12. Organization: Southampton University Computer Science
  13. Lines: 23
  14. Nntp-Posting-Host: louis
  15. In-reply-to: jeroen@cs.ruu.nl's message of 21 Jul 92 08:50:23 GMT
  16.  
  17. In article <1992Jul21.085023.11890@cs.ruu.nl> jeroen@cs.ruu.nl (Jeroen Fokker) writes:
  18. [...]
  19.    >> #define EPSILON 0.00001
  20.  
  21.    >  which of course limits the accuracy quite severly.
  22.  
  23. [...]
  24.  
  25. I've played about with this on my calculator and found that about five
  26. or six iterations of the Newton-Raphson loop is enough for a single
  27. precision result.  I got a first approximation by bit twiddling the
  28. exponent field of the float.
  29.  
  30. Jon. Bently's second `Programming Pearls' book has a column called
  31. `Birth of a Cruncher'.  The column describes how he applied
  32. Newton-Raphson approximation, unrolling, and a bit of clever
  33. approximation to speeding up a calculation with a square root in it.
  34. Most useful is the discussion of the errors generated by
  35. Newton-Raphson approximation---the behaviour of the error justifies
  36. the claim that about six iterations is enough for a single precision
  37. float.
  38. --
  39. Jon.
  40.