Skip to main content

Advertisement

Log in

Floating Point Verification in HOL Light: The Exponential Function

  • Published:
Formal Methods in System Design Aims and scope Submit manuscript

Abstract

Since they often embody compact but mathematically sophisticated algorithms, operations for computing the common transcendental functions in floating point arithmetic seem good targets for formal verification using a mechanical theorem prover. We discuss some of the general issues that arise in verifications of this class, and then present a machine-checked verification of an algorithm for computing the exponential function in IEEE-754 standard binary floating point arithmetic. We confirm (indeed strengthen) the main result of a previousl published error analysis, though we uncover a minor error in the hand proof and are forced to confront several subtle issues that might easily be overlooked informally.

The development described here includes, apart from the proof itself, a formalization of IEEE arithmetic, a mathematical semantics for the programming language in which the algorithm is expressed, and the body of pure mathematics needed. All this is developed logically from first principles using the HOL Light prover, which guarantees strict adherence to simple rules of inference while allowing the user to perform proofs using higher-level derived rules.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. R. Back, Correctness Preserving Program Transformations: Proof Theory and Applications, Mathematical Centre Tracts, Vol. 131, Mathematical Centre, Amsterdam, 1980.

    Google Scholar 

  2. A. Baker, Transcendental Number Theory, Cambridge University Press, 1975.

  3. M. Barratt, “Formal methods applied to a floating-point system, ” IEEE Transactions on Software Engineering, Vol. 15, pp. 611–621, 1989.

    Google Scholar 

  4. J. Barwise, “Mathematical proofs of computer correctness, ” Notices of the American Mathematical Society, Vol. 7, pp. 844–851, 1989.

    Google Scholar 

  5. R. Benedetti and J.-J. Risler, Real Algebraic and Semi-Algebraic Sets, Hermann, Paris, 1990.

  6. B. Brock, M. Kaufmann, and J.S. Moore, “ACL2 theorems about commercial microprocessors, ” in [41], pp.275–293.

    Google Scholar 

  7. C.W. Clenshaw and F.W.J. Olver, “Beyond floating point, ” Journal of the ACM, Vol. 31, pp. 319–328, 1984.

    Google Scholar 

  8. G. Cousineau and M. Mauny, The Functional Approach to Programming, Cambridge University Press, 1998.

  9. R. DeMillo, R. Lipton, and A. Perlis, “Social processes and proofs of theorems and programs, ” Communications of the ACM, Vol. 22, pp. 271–280, 1979.

    Google Scholar 

  10. E.W. Dijkstra,A Discipline of Programming, Prentice-Hall, 1976.

  11. B. Dutertre, “Elements of mathematical analysis in PVS, ” Le langage Caml, InterEditions, 1993. See also the CAML Web page: http:// pauillac.inria.fr/caml/. in [46], pp. 141–156, 1996.

  12. S. Gal, “Computing elementary functions: A new approach for achieving high accuracy and good performance, ” in W.L. Miranker and R.A. Toupin (Eds.), Accurate Scientific Computations, Lecture Notes in Computer Science, 1986, Vol. 235, pp. 1–16.

  13. D. Goldberg, “What every computer scientist should know about floating point arithmetic, ” ACM Computing Surveys, Vol. 23, pp. 5–48, 1991.

    Google Scholar 

  14. M.J.C. Gordon, “Mechanizing programming logics in higher order logic, ” in G. Birtwistle and P.A. Subrahmanyam (Eds.), Current Trends in Hardware Verification and Automated Theorem Proving, pp. 387–439, 1989.

  15. M. Gordon, “The semantic challenge of Verilog HDL, ” in Proceedings of the Tenth Annual IEEE Symposium on Logic in Computer Science, San Diego, CA, USA, pp. 136–145, 1995.

  16. M.J.C. Gordon and T.F. Melham, Introduction to HOL: A Theorem Proving Environment for Higher Order Logic, Cambridge University Press, 1993.

  17. M.J.C. Gordon, R. Milner, and C.P. Wadsworth, Edinburgh LCF: A Mechanised Logic of Computation, Lecture Notes in Computer Science, Vol. 78, Springer-Verlag, 1979.

  18. J. Harrison, “Floating point verification in HOL, ” in P.J. Windley, T. Schubert, and J. Alves-Foss (Eds.), Higher Order Logic Theorem Proving and Its Applications: Proceedings of the 8th International Workshop, Aspen Grove, Utah. Lecture Notes in Computer Science, Vol. 971, pp. 186–199, 1995.

  19. J. Harrison, “HOL Light: A tutorial introduction, ” see [41], pp. 265–269.

    Google Scholar 

  20. J. Harrison, “A Mizar mode for HOL, ” Le langage Caml, InterEditions, 1993. See also the CAML Web page: http://pauillac.inria.fr/caml/. in [46] pp. 203–220.

  21. J. Harrison, “Theorem proving with the real numbers, ” Springer-Verlag. Revised version of author's Ph.D. thesis, 1998.

  22. J. Harrison, “Verifying the accuracy of polynomial approximations in HOL, ” in E.L. Gunter and A. Felty (Eds.), Theorem Proving in Higher Order Logics: 10th International Conference, TPHOLs'97, Murray Hill, NJ. Lecture Notes in Computer Science, Vol. 1275, 1997, pp. 137–152.

  23. J. Harrison, “A machine-checked theory of floating point arithmetic, ” in Y. Bertot, G. Dowek, A. Hirschowitz, C. Paulin, and L. Th´ery (Eds.), Theorem Proving in Higher Order Logics: 12th International Conference, TPHOLs'97, Vol. 1690, Lecture Notes in Computer Science. Nice, France, 1999, pp. 113–130.

  24. IEEE, “Standard for binary floating point arithmetic, ” ANSI/IEEE Standard 754-1985, The Institute of Electrical and Electronic Engineers, Inc., 345 East 47th Street, New York, NY 10017, USA, 1985.

    Google Scholar 

  25. F. Lindemann, “ Ñber die Zahl π, ” Mathematische Annalen, Vol. 120, pp. 213–225, 1882.

    Google Scholar 

  26. D.W. Loveland, “Mechanical theorem-proving by model elimination, ” Journal of the ACM, Vol. 15, pp. 236–251, 1968.

    Google Scholar 

  27. K. Mahler, “On the approximation of logarithms of algebraic numbers, ” Philosophical Transactions of the Royal Society of London, Series A, Vol. 245, pp. 371–398, 1953.

    Google Scholar 

  28. P.S. Miner, “Defining the IEEE-854 Floating-point standard in PVS, ” Technical Memorandum 110167, NASA Langley Research Center, Hampton, VA 23681-0001, USA, 1995.

    Google Scholar 

  29. P.S. Miner and J.F. Leathrum, “Verification of IEEE compliant subtractive division algorithms, ” see [41], pp. 64–78.

    Google Scholar 

  30. J.S. Moore, T. Lynch, and M. Kaufmann, “A mechanically checked proof of the correctness of the kernel of the AMD5K 86 floating-point division algorithm, ” IEEE Transactions on Computers, Vol. 47, pp. 913–926, 1998. Available on the Web as http://devil.ece.utexas.edu:80/lynch/divide/divide.html, 1996.

    Google Scholar 

  31. K.C. Ng, “Argument reduction for huge arguments: Good to the last bit, ” Unpublished draft, available from the author (kwok.ng@eng.sun.com), 1992.

  32. T. Nipkow, “Winskel is (almost) right: Towards a mechanized semantics textbook, ” in V. Chandru and V. Vinay (Eds.), in Foundations of Software Technology and Theoretical Computer Science, 16th Conference, Proceedings. pp. 180–192, 1996.

  33. M. Norrish, “C formalized in HOL, ” Technical Report 453, University of Cambridge Computer Laboratory, New Museums Site, Pembroke Street, Cambridge, CB2 3QG, UK. Author's Ph.D. thesis, 1998.

    Google Scholar 

  34. J. O'Leary, X. Zhao, R. Gerth, and C.-J.H. Seger, “Formally verifying IEEE compliance of floating-point hardware, ” Intel Technology Journal, Vol. 1999-Q1, pp. 1–14. Available on theWeb as http://developer. intel.com/technology/itj/q11999/articles/art 5.htm, 1999.

    Google Scholar 

  35. I. Page, “Constructing hardware-software systems from a single description, ” Journal of VLSI Signal Processing, Vol. 12, pp. 87–107, 1996.

    Google Scholar 

  36. L.C. Paulson, Logic and Computation: Interactive Proof with Cambridge LCF, Cambridge Tracts in Theoretical Computer Science, Vol. 2, Cambridge University Press, 1987.

  37. M. Payne and R. Hanek, “Radian reduction for trigonometric functions, ” SIGNUM Newsletter, Vol. 18, No. 1, pp. 19–24, 1983.

    Google Scholar 

  38. R. Pollack, “How to believe a machine-checked proof, ” in G. Sambin and J. Smith (Eds.), Twenty-Five Years of Constructive Type Theory, Also available on the Web as http://www.brics.dk/pollack/export/ believing.ps.gz, 1998.

  39. V.R. Pratt, “Anatomy of the Pentium bug, ” in P.D. Mosses, M. Nielsen, and M.I. Schwartzbach (Eds.), Proceedings of the 5th International Joint Conference on the Theory and Practice of Software Development (TAPSOFT'95), Aarhus, Denmark. Lecture Notes in Computer Science, Vol. 915, 1995, pp. 97–107.

  40. D. Rusinoff, “Amechanically checked proof of IEEE compliance of a register-transfer-level specification of the AMD-K7 floating-point multiplication, division, and square root instructions, ” LMS Journal of Computation and Mathematics, Vol. 1, pp. 148–200, 1998. Available on the Web via http://www.onr.com/user/ russ/david/k7-div-sqrt.html.

    Google Scholar 

  41. M. Srivas and A. Camilleri (Eds.), in Proceedings of the First International Conference on Formal Methods in Computer-Aided Design (FMCAD'96). Lecture Notes in Computer Science, Vol. 1166, Springer-Verlag, 1996.

  42. P.T.P. Tang, “Table-driven implementation of the exponential function in IEEE floating-point arithmetic, ” ACM Transactions on Mathematical Software, Vol. 15, pp. 144–157, 1989.

    Google Scholar 

  43. A. Trybulec, “The Mizar-QC/6000 logic information language, ” ALLC Bulletin (Association for Literary and Linguistic Computing), Vol. 6, pp. 136–140, 1978.

    Google Scholar 

  44. J. von Wright, J. Grundy, and J. Harrison (Eds.), in Theorem Proving in Higher Order Logics: 9th International Conference, TPHOLs'96, Turku, Finland. Lecture Notes in Computer Science, Vol. 1175, Springer-Verlag, 1996.

  45. J. von Wright, J. Hekanaho, P. Luostarinen, and T. Långbacka, “Mechanizing some advanced refinement concepts, ” Formal Methods in System Design, Vol. 3, pp. 49–82, 1993.

    Google Scholar 

  46. P. Weis and X. Leroy, Le langage Caml, InterEditions, 1993. See also the CAML Web page: http:// pauillac.inria.fr/caml/.

  47. J.H. Wilkinson, Rounding Errors in Algebraic Processes, National Physical Laboratory Notes on Applied Science, Vol. 32, Her Majesty's Stationery Office (HMSO), London, 1963.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Harrison, J. Floating Point Verification in HOL Light: The Exponential Function. Formal Methods in System Design 16, 271–305 (2000). https://doi.org/10.1023/A:1008712907154

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1008712907154

Keywords