encyclopegia.org

2Sum

2Sum is a floating-point algorithm for computing the exact round-off error in a floating-point addition operation. 2Sum and its variant Fast2Sum were first published by Ole Møller in 1965. Fast2Sum is often used implicitly in other algorithms such as compensated summation algorithms; Kahan's summation algorithm was published first in 1965, and Fast2Sum was later factored out of it by Dekker in 1971 for double-double arithmetic algorithms. The names 2Sum and Fast2Sum appear to have been applied retroactively by Shewchuk in 1997.

2Sum is a floating-point algorithm for computing the exact round-off error in a floating-point addition operation. 2Sum and its variant Fast2Sum were first published by Ole Møller in 1965. Fast2Sum is often used implicitly in other algorithms such as compensated summation algorithms; Kahan's summation algorithm was published first in 1965, and Fast2Sum was later factored out of it by Dekker in 1971 for double-double arithmetic algorithms. The names 2Sum and Fast2Sum appear to have been applied retroactively by Shewchuk in 1997. Given two floating-point numbers a and b , 2Sum computes the floating-point sum s := a \oplus b rounded to nearest and the floating-point error t := a + b - (a \oplus b) so that s + t = a + b , where \oplus and \ominus respectively denote the addition and subtraction rounded to nearest. The error t is itself a floating-point number. Inputs floating-point numbers a, b Outputs rounded sum s = a \oplus b and exact error t = a + b - (a \oplus b) s := a \oplus b a' := s \ominus b b' := s \ominus a' \delta_a := a \ominus a' \delta_b := b \ominus b' t := \delta_a \oplus \delta_b return (s, t) Provided the floating-point arithmetic is correctly rounded to nearest (with ties resolved any way), as is the default in IEEE 754, and provided the sum does not overflow and, if it underflows, underflows gradually, it can be proven that A variant of 2Sum called Fast2Sum uses only three floating-point operations, for floating-point arithmetic in radix 2 or radix 3, under the assumption that the exponent of a is at least as large as the exponent of b , such as when Inputs radix-2 or radix-3 floating-point numbers a and b , where either at least one is zero, or which have normalized exponents e_a \geq e_b Outputs rounded sum s = a \oplus b and exact error t = a + b - (a \oplus b) s := a \oplus b z = s \ominus a t = b \ominus z return (s, t) Even if the conditions are not satisfied, 2Sum and Fast2Sum often provide reasonable approximations to the error, i.e. s + t \approx a + b , which enables algorithms for compensated summation, dot-product, etc., to have low error even if the inputs are not sorted or the rounding mode is unusual. More complicated variants of 2Sum and Fast2Sum are used for rounding modes other than round-to-nearest.

References

  1. 2Sum · retrieved 2026-10-19 · rev 1346339078
    Cite this reference

    MLA "2Sum." Wikipedia. 2026-10-19. https://en.wikipedia.org/w/index.php?oldid=1346339078. Accessed 24 November 2026.

    Chicago "2Sum." Wikipedia. 2026-10-19. https://en.wikipedia.org/w/index.php?oldid=1346339078.

    APA Wikipedia. (2026). 2Sum. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1346339078

Cite this article

MLA

"2Sum." encyclopegia.org, 2026, https://encyclopegia.org/wiki/2sum. Accessed 24 November 2026.

Chicago

"2Sum." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/2sum.

APA

encyclopegia.org. (2026). 2Sum. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/2sum

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
publication date1965Wikipedia
publication date1965Wikipedia

Related articles

Sterbenz lemma

enwiki · references available

Renate Howe

enwiki · references available

List of power engineering measuring equipment

enwiki · references available

FC Yunist Chernihiv

enwiki · references available

Edward Hamlin Everett House

enwiki · references available

Hexa(tert-butoxy)ditungsten(III)

enwiki · references available

Takis (name)

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1346339078 · 0.5 · snapshot enwiki-001346339078

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.