Talk:Round-off error

Round-to-even is missing
The article omits discussion of the "round-to-even" strategy, where 0.55 and 0.65 are both rounded to 0.6, and 0.75 and 0.85 are both rounded to 0.8. —Dominus (talk) 22:37, 8 April 2010 (UTC)


 * I added it. Can we cite it? I believe it's covered in The Art of Computer Programming chapter 4, but I can't get at that. —Tamfang (talk) 07:40, 3 February 2011 (UTC)

Patriot missile anecdote

 * The system's computer only had 24-bit precision, so it chopped 0.0001% off timing values, while the accuracy threshold is 20 hours. After the system had been running for 100 hours, an error of 5625/16384 ≈ 0.3433 seconds had accumulated.

Obscure. Why did it chop off one part per million, rather than (at most) one part in 16 million? What does the "while" phrase mean? Why 5625/16384 (the denominator is 2^14)? —Tamfang (talk) 16:58, 22 November 2010 (UTC)

Copyright problem removed
One or more portions of this article duplicated other source(s). The material was copied from: http://mathworld.wolfram.com/RoundoffError.html. Infringing material has been rewritten or removed and must not be restored, unless it is duly released under a compatible license. (For more information, please see "using copyrighted works from others" if you are not the copyright holder of this material, or "donating copyrighted materials" if you are.) For legal reasons, we cannot accept copyrighted text or images borrowed from other web sites or published material; such additions will be deleted. Contributors may use copyrighted publications as a source of information, but not as a source of sentences or phrases. Accordingly, the material may be rewritten, but only if it does not infringe on the copyright of the original or plagiarize from that source. Please see our guideline on non-free text for how to properly implement limited quotations of copyrighted text. Wikipedia takes copyright violations very seriously, and persistent violators will be blocked from editing. While we appreciate contributions, we must require all contributors to understand and comply with these policies. Thank you. M4gnum0n (talk) 14:10, 2 December 2010 (UTC)

Potential incremental rewrite (A bit clearer, some false statements removed)
When a sequence of calculations subject to rounding error is made, errors may accumulate, sometimes dominating the calculation. Cases where significant error accumulates are known as ill-conditioned.

Representation error
The error introduced by attempting to represent a number using a finite string of digits is called representation error. Here are some examples of representation error in decimal representations:

<table class="wikitable" Notation Represent Approximate Error 1/7 0.$\overline{142 857}$ 0.142 857 0.000 000 $\overline{142 857}$ ln 2 0.693 147 180 559 945 309 41... 0.693 147 0.000 000 180 559 945 309 41... log10 2 0.301 029 995 663 981 195 21... 0.3010 0.000 029 995 663 981 195 21... ∛$\overline{ 2 }$ 1.259 921 049 894 873 164 76... 1.25992 0.000 001 049 894 873 164 76... √$\overline{ 2 }$ 1.414 213 562 373 095 048 80... 1.41421 0.000 003 562 373 095 048 80... e 2.718 281 828 459 045 235 36... 2.718 281 828 459 045  0.000 000 000 000 000 235 36... π 3.141 592 653 589 793 238 46... 3.141 592 653 589 793 0.000 000 000 000 000 238 46... Increasing the number of digits allowed in a representation reduces the magnitude of possible round-off errors, but any representation limited to finitely many digits will still cause some degree of round-off error for uncountably many real numbers. Additional digits used for intermediary steps of a calculation are known as guard digits.

Rounding multiple times can cause error to accumulate. For example, if 9.945309 is rounded to two decimal places (9.95), then rounded again to one decimal place (10.0), the total error is 0.054691. Rounding 9.945309 to one decimal place (9.9) in a single step introduces less error (0.045309). This commonly occurs when performing arithmetic operations (See Loss of Significance).

Standardized Rounding Methods
There are five standard ways of performing the rounding in IEEE standard arithmetic:
 * Truncation: Keep the desired number of digits unchanged, removing all less-significant digits; also called rounding toward zero.
 * 0.$\overline{142857}$ ≈ 0.142 (All digits less significant than the third removed).


 * Round to Nearest: Round to the nearest valid representation. Break ties by rounding either to an even digit (default), or away from zero.
 * Round to −∞: Round to a value less than or equal to the original number. If the original number is positive, this is equivalent to truncation.
 * Round to +∞: Round to a value greater than or equal to the original number. If the original number is negative, this is equivalent to truncation.

Breaking ties by rounding toward an even value preserves the expected value of the original number and treats positive and negative numbers symmetrically. Nm160111 (talk) 02:15, 12 September 2012 (UTC)

Historical Examples of Round-off errors
I think that this page would benefit from having section that included some examples of major problems that have occurred in history as a result of Round-off Errors. It might sound something like this:

Historical Examples
There have been several instances though out history in which major disasters have occurred as a result of round-off errors. One example of this occurred during the Gulf War with the American Patriot Missile defense system (MIM-104 Patriot). The system was programmed with 24 bits; therefore, when a number was stored, it was chopped after 24 bits. At first, this only caused a relatively small error, but this small round-off error became significant. In fact, this error caused the Patriot Missile defense system to fail to detect an Iraqi Scud missile, which hit a US Army barracks and killed 28 men.

A second example of a major disaster as a result of a round-off error occurred in 1996 when the Ariane 5 rocket created by Europe was set to make its first flight. Less than forty seconds after take off, the rocket exploded. The cause of this explosion was a 64 bit number was incorrectly rounded into a 16 bit integer. --Lmb.ohio (talk) 20:23, 4 October 2012 (UTC)Lmb.ohio

Assessment comment
Substituted at 02:34, 5 May 2016 (UTC)

Ill conditioned problems (Runge's Phenomenon)
Does Runge's Phenomenon have anything to do with round-off? Humphrey Jungle (talk) 17:51, 6 December 2018 (UTC)
 * I don't think so. It's not about inaccuracy of computation: it happens when you try to use polynomial interpolation with equally spaced interpolation points regardless of how accurately you compute the polynomials. —David Eppstein (talk) 17:56, 6 December 2018 (UTC)

That's what I thought. It doesn't seem to be "ill conditioned" either. The preceding example - an iterative numerical integration - does seem to be ill-conditioned, so maybe the commentary about condition number should be transferred there and Runge's Phenomenon should be removed. (All these are sub-headings under "Accumulation of round-off error") Humphrey Jungle (talk) 23:01, 6 December 2018 (UTC)

... or may be not. Re-reading, there is some distinction between "unstable algorithm" and "ill-conditioned problem" that I have yet to grasp. Humphrey Jungle (talk) 23:05, 6 December 2018 (UTC)

Move to "Roundoff error", or change instances of "roundoff" to "round-off"?
For the sake of consistency, I think the page should either be revised to use the hyphenated form "round-off error" or moved to Roundoff error, though I'm not sure which option would be preferable. The hyphenated form currently doesn't appear anywhere in the article except the title. I've glanced through some of the article's sources and found that both forms are used&mdash;even within the same work&mdash;though the form "round-off error" appears to be more common. (One source also has two instances of "roundoff-error".) Thoughts? —&thinsp;Ardub23 (talk) 04:58, 19 December 2019 (UTC)

Double rounding
Rounding to, say, 30 binary digits and then to 29 indeed can introduce a rounding error rather frequently. However, rounding a 63 bit mantissa to a 52 bit mantissa rarely introduces an error, and if it does, it is 2^-11 ULP, which is trivial. I suppose in some extremely punctilious analysis, it would be worth considering that, but it hardly seems worth discussing in an encyclopedia article, where it is more likely to confuse than enlighten our readers. --Macrakis (talk) 13:15, 19 February 2022 (UTC)

Any mention about only rounding at the final step when possible?
Not wanting to spam here, but linked from here, which shows converting 1/3 to a percentage, and also a difference between 1/3*100 vs. 1*100/3, indicating that the former could not represent 1/3 exactly, before multiplying and showing a greater round-off error than the latter which did not round until dividing by 3, which is the final step. I was taught in school that when possible, avoid rounding (at all or to fewer digits) until the final result after all calculations are made. Joeleoj123 (talk) 01:41, 23 December 2023 (UTC)