Chudnovsky, PiFast, etc

Jim White mathimagics at yahoo.co.uk
Wed Nov 28 16:52:18 CET 2007


RE: Improved timing for chudnovsky.c (cino hilliard)

> What we do is multiply the mpf number by 10^digits. 
> This produces a big integer out of the mantissa. 

The mantissa already IS a big integer!

Think "power method" with scaling by 2 ^ size-in-bits.

> My guess is the speed of this power method is the 
> result of low level optimization of the power 
> function performed in the compiler. 

I would suggest that this is simply the natural
consequence of avoiding formatted output conversion
(ie, radix conversion), and has nothing to do with the
compiler at all.  

> Time to compute = 75.734
> String method time to convert mpf to mpz and save to
>  zpi.bin   = 57.234
> Power  method time to convert mpf to mpz and save to
> zpi2.bin   =  6.594

mpf_out_raw does no "conversion" work at all, so if
you used that to write the result, this step should
take no time at all (other than that dictated by the
amount of data to be dumped)


Cheers

Jim White
MSI, ANU


More information about the gmp-discuss mailing list