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

Palabras clave

Real number computation
functional programming
operational semantics. Real number computation
functional programming
operational semantics.

Cómo citar

Lucatero, A., Marcial-Romero, J. R., & Hernández, J. A. (2012). A Scientific Calculator for Exact Real Number Computation Based on LRT, GMP and FC++. Acta Universitaria, 22, 35–41. https://doi.org/10.15174/au.2012.339

Resumen

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.
https://doi.org/10.15174/au.2012.339
PDF