home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!cwi.nl!dik
- From: dik@cwi.nl (Dik T. Winter)
- Newsgroups: sci.math
- Subject: Re: Rounding Rules
- Message-ID: <8526@charon.cwi.nl>
- Date: 5 Jan 93 23:54:15 GMT
- References: <1992Dec23.140148.21009@hubcap.clemson.edu> <1993Jan4.142226.9639@iscsvax.uni.edu> <a_rubin.726185517@dn66>
- Sender: news@cwi.nl
- Organization: CWI, Amsterdam
- Lines: 51
-
- (Thrown away all attributions to not confuse :-).)
-
- > >> The problem with many of the "rounding rules" is that they are biased.
- > >> In the IEEE round of rules, an attempt is made to make rounding as unbiased
- > >> as possible. Round to even is specified as the rule of choice, since it
- > >> avoids many of the problems of "round to infinity" or "round towards zero".
- >
- > >My personal favorite rounding rule is to round anything that has {0,1,2,3,4} in
- > >the "rounding place" "down" and anything that has {5,6,7,8,9} "up". So as in
- > >the previous example, 1.13500 would be rounded to 1.14 and 1.14500 would be
- > >rounded to 1.15.
- >
- > >To this my teachers always gasped that this method was biased, and no amount of
- > >pursuasion using the above-mentioned sets could pursuade them.
- >
- > Well, it IS biased. Rounding n places is biased by +1/2 10^-n.
- >
- It depends on what context you are using. It is true when rounding real
- numbers (as in mathematics). It is not true when rounding floating point
- numbers. When considering floating point arithmetic (with finite precision)
- you should not consider all infinite precision results before rounding with
- equal probability. Rather you ought to consider the range of possible
- inputs and the operation involved and conclude from that point whether the
- rounding is biased or not.
-
- However, this leads to a more interesting case: is unbiased rounding
- in floating point arithmetic superior to biased rounding? The answer
- is *no*, there are unbiased roundings that are worse than simply
- truncating to zero. While the mean is correct, an actual result can
- be worse. An example provides the multiplication on the Cray. (Now
- bear with me, this is from memory so some numbers may be wrong, but
- the way it works is like this.) When multiplying two numbers (with
- 48 bit mantissa) together, the Cray does not calculate all 48*48 bits
- of intermediate results to add them together. Rather in the 48*96
- array to hold the intermediate results it skips the last 16(?)
- positions and adds 9 to the 80(?)th position. The number 9 is indeed
- the mean value of the omitted bits considering all inputs equally
- probable. When all is added together and additional 3 is added to
- positions 50 and 51. Next, if the leading result bit is zero the
- number is shifted one position (adjusting the exponent). Finally
- the result is truncated to 48 bits. It is not easy to see, but the
- algorithm delivers an unbiased result, but it can be wrong by more
- than 1 bit in the least significant position.
-
- What considering the IEEE standard, it is easy to see that with regards
- to biasedness they could have chosen either round to even or round to
- odd. The reason round to even was chosen is that it actually diminishes
- the need to round on subsequent operations.
- --
- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland
- home: bovenover 215, 1025 jn amsterdam, nederland; e-mail: dik@cwi.nl
-