Post Reply 
Intel Edison generic calculator shield photo journal
04-12-2015, 09:48 PM (This post was last modified: 04-12-2015 09:52 PM by Claudio L..)
Post: #59
RE: Intel Edison generic calculator shield photo journal
(04-12-2015 06:01 AM)MarkHaysHarris777 Wrote:  There are several really good packages (MPFR, MPC, and GMP some of the best) on the front burner... not to mention Python's Decimal. I am planning on comparing the decNumber <sp?> library with the others, of course. What I'm interested in primarily is fast (very fast, say Fast Fourier Transform, FFT) for multiplication at least, but I'm also very interested in arbitrary precision. I want the user to be able to 'select' the intermediate precision register(s) length! --similar to WP34s Double, but without limits (within practical reason). You ought to be able (for whatever reason you dream up) to work a calculation like sqrt(2) to 500 decimal places and scroll left and right on the result; even though no calculator at this time does that... well, except our PCs of course, and my phone!

It seems you are going through the same path I walked last year, so here are a few things that I found out:
* MPFR, MPC and GMP: These are all binary, not decimal floating point (you may or may not care about the difference). They are FAST, and huge. But that's the fastest you'll ever find.
* Python's Decimal (the new implementation for Python 3, which was released as an independent library: search for libmpdec) was the best choice for my project. It's very small compared to others. Much faster than decNumber (or so they claim, I haven't tested it), but some of the advanced algorithms suffer in performance (like LN, POW), since they are not based on tables, they can become slow at higher precisions. It's the price to pay for the smaller footprint. If you are interested in multiplication mainly, it's a good contender and small enough.
* Intel Decimal library: This one is x86 only, so it wasn't a choice for my project (some people manage to make it work on ARM, but I don't think it passes all tests). Since it's optimized for x86, porting to ARM you can be sure that any speed advantages will vanish. It has some large tables, so it's also big. Supposed to be very fast but I didn't test it. EDIT: Forgot to mention this one is not true variable precision, only 32,64 and 128 bits, unlike all others.
* decNumber: good old standards compliant. Probably not as quick as others but reliable, portable and small.

On the Edison, you can probably afford GMP and family, or the Intel library and that should be your first choice for speed (you have plenty of ram, so footprint on the Edison is not a concern).
But if you are planning on other projects with more humble processors too, I'd go for libmpdec, it's more portable (as a consequence of not being so highly optimized) and smaller footprint.

Claudio
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Intel Edison generic calculator shield photo journal - Claudio L. - 04-12-2015 09:48 PM



User(s) browsing this thread: 8 Guest(s)