Skip to main content
Log in

Detection of the maximum error of mathematical functions

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

Floating-point error is one of the important factors that limit the accuracy of calculation. Programs using floating-point numbers are prone to accuracy problems by rounding and catastrophic cancelation. Mathematical library is an essential part of computer system. Its implementation is a common genre of floating-point calculation. Implementing these functions through polynomial expansion has algorithmic error in addition to rounding and catastrophic cancelation. Furthermore, ‘concise’ mathematical functions are frequently developed for applications with high-performance requirements. These ‘concise’ functions pay more attention to performance rather than accuracy. As a result, serious accuracy problems might occur, which will further affect the execution of programs. In this paper, a heuristic approach is designed to detect the maximum error of mathematical functions. It is theoretically proved in Sect. 2 that the maximum error of the mathematical functions generally occurs in small intervals. This finding is further proved by several experiments. The heuristic approach is designed based on it. Firstly, the large-scale test is used to gain the error distribution of functions. After that, the intervals, where the maximum error may occur (called ‘tingle intervals’ in this paper), are derived from the error distribution. At last, the high coverage test over tingle intervals is used to detect the maximum error. We evaluate the algorithm by analyzing mainstream math libraries (MKL, Glibc and Sunway TaihuLight). Our experiments show the approach can correctly deal with over 96.2% of mathematical functions. The approach designed in this paper has been used in the analysis and optimization of Sunway TaihuLight Math Library.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. Benz F (2012) A dynamic program analysis to find floating-point accuracy problems. ACM SIGPLAN Not 47(6):453–462

    Article  Google Scholar 

  2. Aggarwal KK, Singh Y (2001) Software engineering. New International Publishers, New York

    Google Scholar 

  3. Brunie N, Dinechi FD, Kupriianova O, Lauter C (2015) Code generators for mathematical functions. In: IEEE Symposium on Computer Arithmetic, pp 66–73

  4. Lee W, Sharma R, Aiken A (2016) Verify bit-manipulations of floating-point. In: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, New York, NY, USA, pp 70–84

  5. Chiang W-F et al (2017) Rigorous floating-point mixed-precision tuning. ACM SIGPLAN Not 52(1):300–315

    Article  Google Scholar 

  6. Tang E, Zhang X, Meller NT, Chen Z, Li X (2017) Software numerical instability detection and diagnosis by combining stochastic and infinite-precision testing. IEEE Trans Softw Eng 43(10):975–994

    Article  Google Scholar 

  7. Yi X et al (2017) Efficient global search for inputs triggering high floating-point inaccuracies. In: Asia-Pacific Software Engineering Conference (APSEC), 2017 24th. IEEE, pp 11–20

  8. Titolo L et al (2018) An abstract interpretation framework for the round-off error analysis of floating-point programs. In: International Conference on Verification, Model Checking, and Abstract Interpretation. Springer, Cham, pp 516–537

    Google Scholar 

  9. Zou D et al (2015) A genetic algorithm for detecting significant floating-point inaccuracies. IEEE/ACM IEEE Int Conf Softw 1:529–539

    Google Scholar 

  10. Liew D, Schemmel D, Cadar C, Donaldson AF, Zahl R, Wehrle K (2017) Floating-point symbolic execution: a case study in N-version programming. In: 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE), pp 601–612

  11. Yi X, Chen L, Mao X, Ji T (2017) Efficient global search for inputs triggering high floating-point inaccuracies. In: 2017 24th Asia-Pacific Software Engineering Conference (APSEC), pp 11–20

  12. Wu X, Li L, Zhang J (2017) Symbolic execution with value-range analysis for floating-point exception detection. In: 2017 24th Asia-Pacific Software Engineering Conference (APSEC), pp 1–10

  13. Kahan WV (1996) The improbability of probabilistic error analyses for numerical computations. http://www.cs.berkeley.edu/. Accessed 01 May 2018

  14. Cornea M (2014) FSIN documentation improvements in the Intel 64 and IA-32 architectures software developers manual. https://software.intel.com/blogs/2014/10/09/fsin-documentation-improvements-in-the-intel-64-and-ia-32-architectures-software. Accessed 01 May 2018

  15. Xu JC (2015) Testing platform for floating mathematical function libraries. J Softw 26(6):1306–1321

    MathSciNet  Google Scholar 

Download references

Acknowledgements

Funding was provided by National Key R&D Program High Performance Computing Key Projects (Grant No. 2016YFB0200503).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jinchen Xu.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Qi, H., Xu, J. & Guo, S. Detection of the maximum error of mathematical functions. J Supercomput 74, 6275–6290 (2018). https://doi.org/10.1007/s11227-018-2552-x

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-018-2552-x

Keywords

Navigation