Replacing square roots by Pythagorean sums

  • Authors:
  • Cleve Moler;Donald Morrison

  • Affiliations:
  • Department of Computer Science, University of New Mexico, Albuquerque, New Mexico;Department of Computer Science, University of New Mexico, Albuquerque, New Mexico

  • Venue:
  • IBM Journal of Research and Development
  • Year:
  • 1983

Quantified Score

Hi-index 0.00

Visualization

Abstract

An algorithm is presented for computing a "Pythagorean sum" a ⊕ b = √a2 + b2 directly from a and b without computing their squares or takinga square root. No destructive floating point overflows or underflows are possible. The algorithm can be extended to computet he Euclidean norm of a vector. The resulting subroutine is short, portable, robust, and accurate, but not as efficient as some other possibilities. The algorithm is particularly attractive for computers where space and reliability are more important than speed.