🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.fortran
Article #6543

Re: True probabilistic rounding [was Re: Precision ...]

#6543
From: Nick Maclaren
Date: Wed, 01 Oct 2003 10:38
49 lines
3645 bytes
In article <HQweb.382949$2x.123651@rwcrnsc52.ops.asp.att.net>,
"Glen Herrmannsfeldt" <gah@ugcs.caltech.edu> writes:
|> 
|> I am not sure that I understand it so well, but I saw an explanation that to
|> get proper rounding for division with an N bit quotient, it is necessary to
|> calculate 2N quotient bits.    I believe that this is related to the
|> statement about double rounding, where rounding to >=2N bits, and then
|> subsequently to N bits gets the same result as rounding directly to N bits.
|> Intermediate rounding to <2N bits before rounding to N bits can give the
|> wrong answer.

Yes, roughly, though it isn't so simple.  But the latter statements
are definitely correct.

|> The statement about division is in the IBM Systems Journal article on
|> extended precision floating point, and the DXR simulation routine.

It predates that, and is well-known.


The rough summary is that addition, subtraction, comparison and so
on need only a fixed number of extra bits to support any sane form
of rounding, where the number is typically 1 or 2 on top of the
guard bits.

Multiplication is a real pain, because it really needs to be done
to a full NxN -> 2N form, and THEN rounded.  There are optimisations,
of course.

Division is definitely tricky, because it depends on how you do it.
I don't know the methods used in hardware, but the various forms of
repeated subtraction mean that you need calculate only N bits, but
need to do that to 2N precision.  Newton-Raphson is similar.

It is fairly easy to prove that the issues are close to fundamental,
and that ANY accurate multiplication or division method will need
the extra precision.  A long time back (1980s?), R.P. Brent did a
PROPER complexity analysis of the basic operations, and showed why
multiplication was more complex than addition.  Division is well
known to be a simple factor of about 2-3 more expensive than
multiplication, of course, for large numbers of bits.

None of this changes when considering probabilistic versus
deterministic rounding.


Regards,
Nick Maclaren.
Technical Details
Message-ID: <blearb$4m0$1@pegasus.csx.cam.ac.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!west.cox.net!east.cox.net!peer01.cox.net!cox.net!news-hub.cableinet.net!blueyonder!peer.news.eu-x.com!server2.netnews.ja.net!pegasus.csx.cam.ac.uk!nmm1
References: <dG4db.598668$uu5.97984@sccrnsc04> <xrXdb.631209$Ho3.121609@sccrnsc03> <bl9ild$abv$1@pegasus.csx.cam.ac.uk> <Rh0eb.632709$Ho3.121617@sccrnsc03> <bla4k2$nas$1@pegasus.csx.cam.ac.uk> <FR0eb.637973$uu5.101567@sccrnsc04> <r%0eb.163529$3o3.11771639@bgtnsc05-news.ops.worldnet.att.net> <bY1eb.633341$Ho3.121512@sccrnsc03> <Zs2eb.157980$0v4.11847973@bgtnsc04-news.ops.worldnet.att.net> <blbcjf$lrn$1@pegasus.csx.cam.ac.uk> <QEbeb.377802$2x.116648@rwcrnsc52.ops.asp.att.net> <blbmni$g2$1@pegasus.csx.cam.ac.

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd4af,7830916812112af0
X-Google-Attributes: gidfd4af,public
X-Google-Thread: 1094ba,7830916812112af0
X-Google-Attributes: gid1094ba,public
X-Google-Thread: 102b75,7830916812112af0
X-Google-Attributes: gid102b75,public
X-Google-ArrivalTime: 2003-10-01 03:38:37 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!west.cox.net!east.cox.net!peer01.cox.net!cox.net!news-hub.cableinet.net!blueyonder!peer.news.eu-x.com!server2.netnews.ja.net!pegasus.csx.cam.ac.uk!nmm1
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.lang.fortran,comp.arch,bit.listserv.ibm-main
Subject: Re: True probabilistic rounding [was Re: Precision ...]
Date: 1 Oct 2003 10:38:35 GMT
Organization: University of Cambridge, England
Lines: 49
Message-ID: <blearb$4m0$1@pegasus.csx.cam.ac.uk>
References: <dG4db.598668$uu5.97984@sccrnsc04> <xrXdb.631209$Ho3.121609@sccrnsc03> <bl9ild$abv$1@pegasus.csx.cam.ac.uk> <Rh0eb.632709$Ho3.121617@sccrnsc03> <bla4k2$nas$1@pegasus.csx.cam.ac.uk> <FR0eb.637973$uu5.101567@sccrnsc04> <r%0eb.163529$3o3.11771639@bgtnsc05-news.ops.worldnet.att.net> <bY1eb.633341$Ho3.121512@sccrnsc03> <Zs2eb.157980$0v4.11847973@bgtnsc04-news.ops.worldnet.att.net> <blbcjf$lrn$1@pegasus.csx.cam.ac.uk> <QEbeb.377802$2x.116648@rwcrnsc52.ops.asp.att.net> <blbmni$g2$1@pegasus.csx.cam.ac.
NNTP-Posting-Host: libra.cus.cam.ac.uk
Originator: nmm1@libra.cus.cam.ac.uk