Speed of GMP relative to MPFR for quad precision calculations

Vincent Lefevre vincent at vinc17.net
Fri Nov 2 10:09:03 CET 2012

On 2012-11-02 09:01:29 +0100, Paul Zimmermann wrote:
> maybe GMP mpf will run slightly faster, but timings should be very
> close, since both rely on GMP mpn layer. See
> http://www.mpfr.org/mpfr-3.1.0/timings.html for some timings for
> larger precisions.

Yes, with the advantage of MPFR that results are reproducible across
different architectures (this may be important with some applications).

BTW, if only additions and multiplications (and conversion to double
precision) are needed, SCSLib[*] outperformed MPF on some platforms
(but this was 10 years ago, and SCSLib is no longer maintained). In
SCSLib, the precision is chosen at compile time. SCSLib also uses the
technique consisting in aggregating carries before propagating them;
this gives better performance on some platforms. This technique (or
a similar one) can also be enabled in GMP (if still supported -- but
*not* with MPFR), where it is called "nails".

[*] http://www.ens-lyon.fr/LIP/Arenaire/Ware/SCSLib/

Vincent Lefèvre <vincent at vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-discuss mailing list