English

Linear-Time Approximation Algorithms for Computing Numerical Summation with Provably Small Errors

Data Structures and Algorithms 2024-09-21 v2 Numerical Analysis Numerical Analysis

Abstract

Given a multiset X={x1,...,xn}X=\{x_1,..., x_n\} of real numbers, the {\it floating-point set summation} problem asks for Sn=x1+...+xnS_n=x_1+...+x_n. Let EnE^*_n denote the minimum worst-case error over all possible orderings of evaluating SnS_n. We prove that if XX has both positive and negative numbers, it is NP-hard to compute SnS_n with the worst-case error equal to EnE^*_n. We then give the first known polynomial-time approximation algorithm that has a provably small error for arbitrary XX. Our algorithm incurs a worst-case error at most 2(\mix)En2(\mix)E^*_n.\footnote{All logarithms log\log in this paper are base 2.} After XX is sorted, it runs in O(n) time. For the case where XX is either all positive or all negative, we give another approximation algorithm with a worst-case error at most loglognEn\lceil\log\log n\rceil E^*_n. Even for unsorted XX, this algorithm runs in O(n) time. Previously, the best linear-time approximation algorithm had a worst-case error at most lognEn\lceil\log n\rceil E^*_n, while EnE^*_n was known to be attainable in O(nlogn)O(n \log n) time using Huffman coding.

Keywords

Cite

@article{arxiv.cs/9907015,
  title  = {Linear-Time Approximation Algorithms for Computing Numerical Summation with Provably Small Errors},
  author = {Ming-Yang Kao and Jie Wang},
  journal= {arXiv preprint arXiv:cs/9907015},
  year   = {2024}
}