Speed of GMP relative to MPFR for quad precision calculations

Zimmermann Paul Paul.Zimmermann at loria.fr
Fri Nov 2 22:42:22 CET 2012


       Jerry,

> BTW, I _am_ correct in thinking that setting the precision to 30 digits is roughly quad precision, right? I'm still studying the docs and so far have found only references to setting precision by bits, not digits. I believe I got the "digits" idea from an example.

quad precision (as defined by IEEE 754) is a 128-bit format, with 113-bit
significand. Thus to compare with MPFR you should use mpfr_init2 (x, 113).

> I am seeing a piece of code that takes about two minutes to execute in double precision taking about two _hours_ in 30-digit precision. Does that sound about right? FWIW, I am using MPFR through the Ada binding.

as already said by Torbjörn, it might be the Ada binding contributes to the
overhead, but if you are doing 100% arithmetic, a factor of up to 50 between
MPFR and hardware is possible for double precision.

Paul Zimmermann

PS: maybe this becomes off-topic for the gmp-discuss list...


More information about the gmp-discuss mailing list