Pi_Chud Demo, mpf_out_str, etc

Torbjorn Granlund tege at swox.com
Tue Nov 13 01:38:43 CET 2007


  To the best of my recollection:

  1. Some convert-to-string functions in gmp were quite
  inefficient, until improvements were recently made
  (these from Paul Zimmermann, MPFR team).

MPFR and GMP are distinct, and the gmp-chudnovsky.c program uses just
GMP.  Perhaps Paul Zimmermann made some improvements to the mpfr
conversion routines, but he did not, as far as I can tell, do any
public work on GMP's mpf conversion routines.  (The one culprit behind
the conversion code released with GMP is myself.)

  2. Since GMP 4.2, I have had no such problems, nor
  have I had any problems with the pi-chudnovsky demo
  program.  Moving on from GMP 4.1 seems to be a prudent
  step.

Both mpf_get_str and mpf_out_str used to need runtime quadratic to the
number of digits produced.  Now it is O(M(n)).

For those really concerned with conversion speed, I've made a number
of improvements to the underlying mpn_get_str code, see
http://gmplib.org/devel/.  That code improves conversion of operands
of at least a few hundred digits, but there should soon be code in the
same place that is about twice as fast for smaller operands.

-- 
Torbjörn


More information about the gmp-discuss mailing list