Abstract
The prefix-sum operation, which returns all prefix sums on a sequence of numbers, plays an important role in many applications. We study how to efficiently evaluate prefix sums on positive floating-point numbers such that the worst-case roundoff error of each sum is minimized. A direct approach to this problem builds a Huffman tree for each prefix subsequence from scratch, requiring exactly quadratic time for every input X. We can do better by taking advantage of the current Huffman tree to build the next Huffman tree, using dynamic insertions and deletions on Huffman trees. Consequently, subquadratic time suffices for various input patterns. We also provide experimental comparisons of all the algorithms studied in this paper on inputs that are randomly and uniformly generated.
Original language | English (US) |
---|---|
Pages (from-to) | 101-115 |
Number of pages | 15 |
Journal | Theoretical Computer Science |
Volume | 262 |
Issue number | 1-2 |
DOIs | |
State | Published - 2001 |
Funding
Some of the results in this paper appeared in the Proceedings of the 25th International Colloquium on Automata, Languages, and Programming, 1998, pp. 376–386. ∗Corresponding author. E-mail address: [email protected] (J. Wang). 1Supported in part by NSF under Grant CCR-9531028. 2Supported in part by NSF under Grants CCR-9424164 and by the University of North Carolina at Greensboro through a research grant.
ASJC Scopus subject areas
- Theoretical Computer Science
- General Computer Science