home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / math / 17731 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.2 KB

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