A Scientific Calculator for Exact Real Number Computation Based on LRT, GMP and FC++

Palabras clave

Real number computation
functional programming
operational semantics.


Language for Redundant Test (LRT) is a programming language for exact real number computation. Its lazy evaluation mechanism (also called call-by-need) and its infinite list requirement, make the language appropriate to be implemented in a functional programming language such as Haskell. However, a direction translation of the operational semantics of LRT into Haskell as well as the algorithms to implement basic operations (addition subtraction, multiplication, division) and trigonometric functions (sin, cosine, tangent, etc.) makes the resulting scientific calculator time consuming and so inefficient. In this paper, we present an alternative implementation of the scientific calculator using FC++ and GMP. FC++ is a functional C++ library while GMP is a GNU multiple presicion library. We show that a direct translation of LRT in FC++ results in a faster scientific calculator than the one presented in Haskell.