<DIV>I read with interest the August discussion regarding MPF vs MPFR performance.</DIV>
<DIV> </DIV>
<DIV>I've returned to GMP and MPFR after a long absence, and just happen to be</DIV>
<DIV>doing a project for a Computational Science unit I'm studying at uni. My chosen</DIV>
<DIV>topic is to look at performance of elementary function evaluation algorithms</DIV>
<DIV>in some different arbitrary precision packages, and the systems I've chosen </DIV>
<DIV>to compare are GMP/MPFR, David Bailey's ARPREC (which uses floating</DIV>
<DIV>point limbs rather than integers) and Java's BigDecimal class.</DIV>
<DIV> </DIV>
<DIV>As a first step, I created a simple benchmark program to thoroughly exercise</DIV>
<DIV>the multiply, divide and add operators, to provide an indicative raw performance</DIV>
<DIV>indicator for each system at various precisions (1000, 2000, 5000 and</DIV>
<DIV>10000 digits, ie. roughly 3K to 32K bits).</DIV>
<DIV> </DIV>
<DIV>The benchmark test computes e^e, using a simple (unoptimised) power-series </DIV>
<DIV>evaluation of the exponential function, i.e. exp(x) = 1 + x + x^2/2 + x^3/3! ...... </DIV>
<DIV> </DIV>
<DIV>The point that was made in the August discussion regarding the relative speed of </DIV>
<DIV>basic operations in MPFR vs MPF modes is confirmed by the results I'm getting.</DIV>
<DIV> </DIV>
<DIV>Firstly, I have verified that the number of iterations and operations, and the result, </DIV>
<DIV>is exactly the same in both modes). </DIV>
<DIV> </DIV>
<DIV>If I calculate X = exp(1) in 5000-digit precision, then the MPFR mode is 40 times</DIV>
<DIV>slower. But if I then take that result and calculate exp(X) then the MPFR mode is</DIV>
<DIV>only 3 times slower, or to be more precise, the MPF mode is itself proportionately</DIV>
<DIV>slower, as the X term in the series expansion starts off with a full load of limbs.</DIV>
<DIV> </DIV>
<DIV>The very nature of this test, an iteratively converging series summation, </DIV>
<DIV>is precisely the sort of calculation not suitable for MPFR - such algorithms clearly</DIV>
<DIV>are going to be better off with dynamic precision. But it does demonstrate the</DIV>
<DIV>point that the basic operations in MPFR mode are probably just as efficient as MPF</DIV>
<DIV>mode, but only when the MPF operands are actually occupying the full precision.</DIV>
<DIV> </DIV>
<DIV>Cheers</DIV>
<DIV> </DIV>
<DIV>Jim White</DIV>
<DIV>Mathimagics Software Engineering</DIV>
<DIV>Canberra, Australia</DIV>
<DIV> </DIV>