Table of Contents
Fetching ...

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

Ming-Yang Kao, Jie Wang

TL;DR

It is proved that if X has both positive and negative numbers, it is NP-hard to compute Sn with the worst-case error equal to E^*_n, and the first known polynomial-time approximation algorithm that has a provably small error for arbitrary X is given.

Abstract

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

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

TL;DR

It is proved that if X has both positive and negative numbers, it is NP-hard to compute Sn with the worst-case error equal to E^*_n, and the first known polynomial-time approximation algorithm that has a provably small error for arbitrary X is given.

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.

Paper Structure

This paper contains 5 sections, 16 theorems, 10 equations, 3 algorithms.

Key Result

lemma 1

Let $z$ be an internal node in $T_{\min}$ with children $z_1$ and $z_2$, sibling $u$, and parent $r$.

Theorems & Definitions (33)

  • lemma 1
  • proof
  • lemma 2
  • proof
  • lemma 3
  • proof
  • lemma 4
  • proof
  • lemma 5
  • proof
  • ...and 23 more