Math functions on BigDecimal paper

10 views
Skip to first unread message

Ahmed Fasih

unread,
Oct 18, 2009, 11:38:48 PM10/18/09
to Incanter
Greetings, I was discussing recently discussing on #clojure the need
for a BigDecimal-aware exp function for Clojure/Incanter. I found this
recent paper on Arxiv which implements a long list of BigDecimal-aware
math functions in Java:

http://arxiv.org/abs/0908.3030

(The Java code comprises the bulk of the pdf.) I will plan on basing
my efforts to get arbitrary-precision exp into Incanter/Clojure on
this? Thanks for any hints on how to do this,

Ahmed

David Edgar Liebke

unread,
Oct 19, 2009, 10:49:21 AM10/19/09
to inca...@googlegroups.com
Hi Ahmed,

Sounds like a great project to include in Incanter.

As far as implementation hints, check out how Rich transparently
handles BigDecimal values in Clojure's built-in math operators (e.g.
clojure.core/+), and use that approach to implement a version of exp,
using the paper's algorithm when the argument is a BigDecimal and
java.lang.Math/exp when it's not. Then we can replace the call to
Math/exp in incanter.core/exp with your function.

Of course, BigDecimal support still won't exist when the argument to
exp is an incanter.Matrix object, since PColt doesn't support
BigDecimal matrices.

I didn't find a reference to which license the code from the paper is
released under, we need to find out. Hopefully, it's more permissive
than GPL, something like BSD, Apache, Eclipse, or even LGPL.


David

Reply all
Reply to author
Forward
0 new messages