Jekejeke Prolog 1.1.8 (multi precision functions)
Jan Burse, created Mar 03. 2017
We have just uploaded the new release of Jekejeke Prolog. We have added a new package for multi precision arithmetic and functions.
- Multi Precision Arithmetic:
To run the arithmetic and functions either Jekejeke Minlog together with Jekejeke Runtime, or Jekejeke Minlog together with Jekejeke Development have to be installed. The main predicate is a new evaluable functions mp/2:
?- X is mp(sqrt(2), 30).
X = 0d1.41421356237309504880168872422
- Multi Precision Functions:
The implemented number objects are decimals and their internal representation are the Java BigDecimal class. For the arithmetic operations we could directly delegate to the Java BigDecimal class. We also implemented algebraic, exponential and trigonometric functions such as sqrt/1, exp/1, tan/1, etc.. mainly based on Maclaurin and Taylor series:
?- X is mp(tan(pi/8)+1, 30).
X = 0d1.41421356237309504880168872421
The functions are not yet optimized for speed and accuracy. Nevertheless the speed is already comparable to the MATLAB vpa functions despite the fact that the functions are implemented in Prolog itself. The source code can be found on GitHub. There is still room for optimization which we postpone for a next release:
?- X is mp(sqrt(3+2*sqrt(2))-sqrt(2), 30).
X = 0d1.00000000000000000000000000004