home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!icdoc!sot-ecs!jjh91r
- From: jjh91r@ecs.soton.ac.uk (Jon. Hallett)
- Newsgroups: comp.programming
- Subject: Re: Calculating a cube root
- Message-ID: <JJH91R.92Jul22102552@louis.ecs.soton.ac.uk>
- Date: 22 Jul 92 09:25:52 GMT
- References: <l624kmINN29e@girtab.usc.edu> <129360001@hpfcso.FC.HP.COM>
- <1992Jul20.123722.27958@cs.ruu.nl>
- <1992Jul20.160255.17562@organpipe.uug.arizona.edu>
- <1992Jul21.085023.11890@cs.ruu.nl>
- Sender: news@ecs.soton.ac.uk
- Organization: Southampton University Computer Science
- Lines: 23
- Nntp-Posting-Host: louis
- In-reply-to: jeroen@cs.ruu.nl's message of 21 Jul 92 08:50:23 GMT
-
- In article <1992Jul21.085023.11890@cs.ruu.nl> jeroen@cs.ruu.nl (Jeroen Fokker) writes:
- [...]
- >> #define EPSILON 0.00001
-
- > which of course limits the accuracy quite severly.
-
- [...]
-
- I've played about with this on my calculator and found that about five
- or six iterations of the Newton-Raphson loop is enough for a single
- precision result. I got a first approximation by bit twiddling the
- exponent field of the float.
-
- Jon. Bently's second `Programming Pearls' book has a column called
- `Birth of a Cruncher'. The column describes how he applied
- Newton-Raphson approximation, unrolling, and a bit of clever
- approximation to speeding up a calculation with a square root in it.
- Most useful is the discussion of the errors generated by
- Newton-Raphson approximation---the behaviour of the error justifies
- the claim that about six iterations is enough for a single precision
- float.
- --
- Jon.
-