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.
Similar content being viewed by others
References
R. Back, Correctness Preserving Program Transformations: Proof Theory and Applications, Mathematical Centre Tracts, Vol. 131, Mathematical Centre, Amsterdam, 1980.
A. Baker, Transcendental Number Theory, Cambridge University Press, 1975.
M. Barratt, “Formal methods applied to a floating-point system, ” IEEE Transactions on Software Engineering, Vol. 15, pp. 611–621, 1989.
J. Barwise, “Mathematical proofs of computer correctness, ” Notices of the American Mathematical Society, Vol. 7, pp. 844–851, 1989.
R. Benedetti and J.-J. Risler, Real Algebraic and Semi-Algebraic Sets, Hermann, Paris, 1990.
B. Brock, M. Kaufmann, and J.S. Moore, “ACL2 theorems about commercial microprocessors, ” in [41], pp.275–293.
C.W. Clenshaw and F.W.J. Olver, “Beyond floating point, ” Journal of the ACM, Vol. 31, pp. 319–328, 1984.
G. Cousineau and M. Mauny, The Functional Approach to Programming, Cambridge University Press, 1998.
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.
E.W. Dijkstra,A Discipline of Programming, Prentice-Hall, 1976.
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.
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.
D. Goldberg, “What every computer scientist should know about floating point arithmetic, ” ACM Computing Surveys, Vol. 23, pp. 5–48, 1991.
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.
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.
M.J.C. Gordon and T.F. Melham, Introduction to HOL: A Theorem Proving Environment for Higher Order Logic, Cambridge University Press, 1993.
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.
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.
J. Harrison, “HOL Light: A tutorial introduction, ” see [41], pp. 265–269.
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.
J. Harrison, “Theorem proving with the real numbers, ” Springer-Verlag. Revised version of author's Ph.D. thesis, 1998.
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.
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.
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.
F. Lindemann, “ Ñber die Zahl π, ” Mathematische Annalen, Vol. 120, pp. 213–225, 1882.
D.W. Loveland, “Mechanical theorem-proving by model elimination, ” Journal of the ACM, Vol. 15, pp. 236–251, 1968.
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.
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.
P.S. Miner and J.F. Leathrum, “Verification of IEEE compliant subtractive division algorithms, ” see [41], pp. 64–78.
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.
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.
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.
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.
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.
I. Page, “Constructing hardware-software systems from a single description, ” Journal of VLSI Signal Processing, Vol. 12, pp. 87–107, 1996.
L.C. Paulson, Logic and Computation: Interactive Proof with Cambridge LCF, Cambridge Tracts in Theoretical Computer Science, Vol. 2, Cambridge University Press, 1987.
M. Payne and R. Hanek, “Radian reduction for trigonometric functions, ” SIGNUM Newsletter, Vol. 18, No. 1, pp. 19–24, 1983.
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.
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.
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.
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.
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.
A. Trybulec, “The Mizar-QC/6000 logic information language, ” ALLC Bulletin (Association for Literary and Linguistic Computing), Vol. 6, pp. 136–140, 1978.
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.
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.
P. Weis and X. Leroy, Le langage Caml, InterEditions, 1993. See also the CAML Web page: http:// pauillac.inria.fr/caml/.
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.
Author information
Authors and Affiliations
Rights 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
Issue Date:
DOI: https://doi.org/10.1023/A:1008712907154