What is the fastest semi-arbitrary precision math library? [closed]
Asked Answered
R

2

5

I'm using long double in a C program to compute 2D images of the Mandelbrot Set but wish to have further precision to zoom deeper.

Are there any performance gains to be had from an arbitrary precision maths library that can restrict the amount of precision as required, rather than leaping from long double precision straight into arbitrary precision?

Which is the fastest of the arbitrary precision maths libraries?

Ribald answered 30/12, 2009 at 16:31 Comment(2)
Here's the result if anyone's interested: jwm-art.net/mdzRibald
if you don't need arbitrary precision then boost::multiprecision, with precision "may be arbitrarily large (limited only by available memory), fixed at compile time (for example 50 or 100 decimal digits), or a variable controlled at run-time by member functions", may be better than GMP. Or you can use ttmath as mentioned hereBestow
U
6

'fastest' is going to be somewhat dependent on your platform and intended use.

The MPFR Library

GMP

This wiki article contains links to several libraries.

Unilobed answered 30/12, 2009 at 16:48 Comment(2)
+1; mpfr is the gold standard.Yonder
I've been using MPFR since your answer. To use, it is much like how I remember MAPM to be, which I used a few years ago on a much older computer. Back then, MAPM on old 32bit hardware was unusable for generating Mandelbrot images even without zooming in at all. Now, on much faster 64bit hardware, MPFR is definitely usable. Poor comparison I know... ... ... ...Ribald
A
2

If you need more precision, see qd at http://crd.lbl.gov/~dhbailey/mpdist/.

Anticosti answered 30/12, 2009 at 22:1 Comment(2)
It only seems to mention C++, not C as this question is tagged.Ribald
qd does have a C API. The core code is in C++.Anticosti

© 2022 - 2024 — McMap. All rights reserved.