Linear-Time Approximation Algorithms for Computing Numerical Summation with Provably Small Errors
Abstract
Given a multiset of real numbers, the {\it floating-point set summation} problem asks for . Let denote the minimum worst-case error over all possible orderings of evaluating . We prove that if has both positive and negative numbers, it is NP-hard to compute with the worst-case error equal to . We then give the first known polynomial-time approximation algorithm that has a provably small error for arbitrary . Our algorithm incurs a worst-case error at most .\footnote{All logarithms in this paper are base 2.} After is sorted, it runs in O(n) time. For the case where is either all positive or all negative, we give another approximation algorithm with a worst-case error at most . Even for unsorted , this algorithm runs in O(n) time. Previously, the best linear-time approximation algorithm had a worst-case error at most , while was known to be attainable in time using Huffman coding.
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}
}