Re: Pi upto a Billion Digits

• To: mathgroup at smc.vnet.net
• Subject: [mg75672] Re: Pi upto a Billion Digits
• From: Szabolcs <szhorvat at gmail.com>
• Date: Tue, 8 May 2007 05:54:55 -0400 (EDT)
• Organization: University of Bergen
• References: <f1msfm\$rnf\$1@smc.vnet.net>

```Raj wrote:
> hi!
>
> Could somebody tell me if they ever tried finding Pi upto a billion
> digits using the N function:
> N[Pi,10^9] and how long did it take?
>
> Thanks,
>
> Raj

I haven't tried it, but you can estimate how long it takes, like this:

d = Table[Update[]; First@Timing[N[Pi, 2^k 10^5]], {k, 1, 6}]/Second

{1.437, 3.579, 9.14, 23.375, 58.453, 143.391}

(Results are from Mathematica 5.2, 1.7 GHz processor.)

ListPlot[Log@d]

Now we can extrapolate. Find the slope of Log@d

slope = Mean@ListConvolve[{1, -1}, Log@d]

0.920604

10^9 is approximately 2^12 * 10^5, so you can expect

Exp[11*slope + d[[1]] ]

105202.

This is approximately 30 hours. Of course this result may be an order of
magnitude off, but I suspect that the precise result is less than 30
hours, not more. With a little patience you can get a much better estimate.

Or you can leave the calculation running for a day and hope that you
don't run out of memory (memory usage may be a bigger problem than CPU
time). If you do run the calculation, please let us know your findings.

But note that the time to export the result to a file may be comparable
to the time of the calculation (or even much longer -- Mathematica I/O
is pretty slow).

Szabolcs

```

• Prev by Date: Eigenvalues in Mathematica 6.0.0 are SLOW
• Next by Date: Re: Re: Re: Re:
• Previous by thread: Re: Pi upto a Billion Digits
• Next by thread: Re: Re: Pi upto a Billion Digits