Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: Jekejeke Prolog 1.1.8 (multi precision functions)

18 views
Skip to first unread message

j4n bur53

unread,
Mar 3, 2017, 3:18:44 PM3/3/17
to
Jan Burse, Mar 03. 2017, 21:03

Dear All,

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:

?- use_module(library(decimal/multi)).

?- 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

- Disclaimer:
The functions are not yet optimized for speed and
accuracy. Although 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

Happy coding!

Jan Burse, Mar 03. 2017
http://www.jekejeke.ch/
0 new messages