Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

On Ziv's rounding test

Published: 23 July 2013 Publication History

Abstract

A very simple test, introduced by Ziv, allows one to determine if an approximation to the value f(x) of an elementary function at a given point x suffices to return the floating-point number nearest f(x). The same test may be used when implementing floating-point operations with input and output operands of different formats, using arithmetic operators tailored for manipulating operands of the same format. That test depends on a “magic constant” e. We show how to choose that constant e to make the test reliable and efficient. Various cases are considered, depending on the availability of an fma instruction, and on the range of f(x).

References

[1]
Boldo, S. and Melquiond, G. 2008. Emulation of FMA and correctly rounded sums: proved algorithms using rounding to odd. IEEE Trans. Comput. 57, 4, 462--471.
[2]
de Dinechin, F., Ershov, A. V., and Gast, N. 2005. Towards the post-ultimate libm. In Proceedings of the 17th IEEE Symposium on Computer Arithmetic (ARITH'05). IEEE, 288--295.
[3]
Dekker, T. J. 1971. A floating-point technique for extending the available precision. Numerische Mathematik 18, 3, 224--242.
[4]
IEEE. 2008. IEEE Standard for Floating-Point Arithmetic. IEEE Standard 754-2008. http://ieeexplore.ieee. org/servlet/opac?punumber=4610933.
[5]
Jeannerod, C.-P., Louvet, N., Muller, J.-M., and Panhaleux, A. 2011. Midpoints and exact points of some algebraic functions in floating-point arithmetic. IEEE Trans. Comput. 60, 2.
[6]
Kahan, W. 1983. Minimizing q*m-n. http://http.cs.berkeley.edu/∼wkahan/(At the beginning of the file “nearpi.c”).
[7]
Kahan, W. 2004. A logarithm too clever by half. http://http.cs.berkeley.edu/∼wkahan/LOG10HAF.TXT.
[8]
Knuth, D. 1998. The Art of Computer Programming 3rd Ed. Vol. 2. Addison-Wesley, Reading, MA.
[9]
Monniaux, D. 2008. The pitfalls of verifying floating-point computations. ACM Trans. Program. Lang. Syst. 30, 3, 1--41.
[10]
Muller, J.-M. 2006. Elementary Functions, Algorithms and Implementation 2nd Ed., Birkhäuser, Boston, MA.
[11]
Muller, J.-M., Brisebarre, N., de Dinechin, F., Jeannerod, C.-P., Lefèvre, V., Melquiond, G., Revol, N., Stehlé, D., and Torres, S. 2010. Handbook of Floating-Point Arithmetic. Birkhäuser, Boston, MA.
[12]
Neumaier, A. 1974. Rundungsfehleranalyse einiger Verfahren zur Summation endlicher Summen. ZAMM 54, 39--51. (In German.)
[13]
Ogita, T., Rump, S. M., and Oishi, S. 2005. Accurate sum and dot product. SIAM J. Sci. Comput. 26, 6, 1955--1988.
[14]
Pichat, M. 1972. Correction d'une somme en arithmétique ‘a virgule flottante. Numerische Mathematik 19, 400--406. (In French.)
[15]
Ziv, A. 1991. Fast evaluation of elementary mathematical functions with correctly rounded last bit. ACM Trans. Math. Softw. 17, 3, 410--423.

Cited By

View all
  • (2023)Accurate Calculation of Euclidean Norms Using Double-word ArithmeticACM Transactions on Mathematical Software10.1145/356867249:1(1-34)Online publication date: 21-Mar-2023
  • (2023)Towards a correctly-rounded and fast power function in binary64 arithmetic2023 IEEE 30th Symposium on Computer Arithmetic (ARITH)10.1109/ARITH58626.2023.00028(111-118)Online publication date: 4-Sep-2023
  • (2018)A Correctly Rounded Mixed-Radix Fused-Multiply-Add2018 IEEE 25th Symposium on Computer Arithmetic (ARITH)10.1109/ARITH.2018.8464818(21-28)Online publication date: Jun-2018
  • Show More Cited By

Recommendations

Reviews

Kai Diethelm

When working in classical finite precision arithmetic, one is often faced with the following problem: the result of a computation cannot be represented exactly. In such cases, one usually has the goal of constructing the computation algorithm so that the output is the floating-point number nearest to the exact result, where "nearest" is determined according to the rounding mode selected by the user. Ziv developed a now-classical test that can be used to find out whether or not a given approximate solution to a calculation has this desirable property [1]. An interesting extension of Ziv's approach arises when the algorithm's input values are assumed to be of a higher precision than the output data. A crucial parameter in all variants of Ziv's test is a so-called "magic constant" that needs to be chosen by the user in a very careful way. If it is too small, then the test will be worthless because it can produce falsely positive results. In other words, incorrectly rounded values will not be recognized as wrong and thus will be accepted. This is an outcome that should certainly be avoided. On the other hand, a too-large value of the magic constant will lead to a high probability of false negatives, meaning correct results will not be recognized as such. In those cases, the user will be unnecessarily forced to repeat his or her computation with smaller tolerances, thus increasing the computational cost. In this paper, de Dinechin et al. provide a detailed investigation of the properties of the magic constant and derive a method for choosing this parameter in a suitable way. Moreover, they demonstrate that their ideas lead to an almost optimal choice of the magic constant. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Mathematical Software
ACM Transactions on Mathematical Software  Volume 39, Issue 4
July 2013
163 pages
ISSN:0098-3500
EISSN:1557-7295
DOI:10.1145/2491491
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 July 2013
Accepted: 01 January 2013
Received: 01 May 2012
Published in TOMS Volume 39, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Floating-Point arithmetic
  2. correct rounding
  3. elementary functions

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)2
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Accurate Calculation of Euclidean Norms Using Double-word ArithmeticACM Transactions on Mathematical Software10.1145/356867249:1(1-34)Online publication date: 21-Mar-2023
  • (2023)Towards a correctly-rounded and fast power function in binary64 arithmetic2023 IEEE 30th Symposium on Computer Arithmetic (ARITH)10.1109/ARITH58626.2023.00028(111-118)Online publication date: 4-Sep-2023
  • (2018)A Correctly Rounded Mixed-Radix Fused-Multiply-Add2018 IEEE 25th Symposium on Computer Arithmetic (ARITH)10.1109/ARITH.2018.8464818(21-28)Online publication date: Jun-2018
  • (2018)Evaluating Floating-Point Elementary FunctionsHandbook of Floating-Point Arithmetic10.1007/978-3-319-76526-6_10(375-433)Online publication date: 3-May-2018
  • (2016)Computing floating-point logarithms with fixed-point operations2016 IEEE 23nd Symposium on Computer Arithmetic (ARITH)10.1109/ARITH.2016.24(156-163)Online publication date: Jul-2016
  • (2016)A new open-source SIMD vector libm fully implemented with high-level scalar C2016 50th Asilomar Conference on Signals, Systems and Computers10.1109/ACSSC.2016.7869070(407-411)Online publication date: Nov-2016

View Options

Get Access

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media