MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Pi upto a Billion Digits

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75740] Re: [mg75672] Re: Pi upto a Billion Digits
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Wed, 9 May 2007 04:41:52 -0400 (EDT)
  • References: <f1msfm$rnf$1@smc.vnet.net> <6330655.1178621270967.JavaMail.root@m35> <op.tr0m9xlequ6oor@monster.ma.dl.cox.net> <16477279.1178641983790.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

Calculating N[Pi,2*10^8], I got an abnormal termination from the  
C++ library after ten or fifteen minutes.

So... 10^9 is out of the question on my machine.

Bobby

On Tue, 08 May 2007 11:29:51 -0500, Szabolcs Horvát <szhorvat at gmail.com>  
wrote:

> On 08/05/07, DrMajorBob <drmajorbob at bigfoot.com> wrote:
>> On my machine (WinXP, Athlon 3200+, 2GB RAM, Mathematica 6), I estimate
>> 3.4 hours:
>
> Did you run the calculation?
>
>
>>
>> Timing[data =
>>    Table[Update[];
>>     Log@{#, First@Timing[N[Pi, #]]} &[2^k 10^5], {k, 1, 8}]]
>>
>> {231.921, {{Log[200000], -1.06711}, {Log[400000], -0.226901}, {Log[
>>      800000], 0.669879}, {Log[1600000], 1.50741}, {Log[3200000],
>>     2.37052}, {Log[6400000], 3.21451}, {Log[12800000],
>>     4.05123}, {Log[25600000], 4.87675}}}
>>
>> (I doubled two steps more than Szabolcs did.)
>>
>> The log-log data is VERY linear:
>>
>> Needs["LinearRegression`"]
>> AdjustedRSquared /. Regress[data, x, x]
>>
>> 0.999901
>>
>> Clear[a, b, z, logSecs, hours]
>> model = a + b z;
>> logSecs[z_] = model /. FindFit[data, model, {a, b}, z]
>> hours[z_] := Exp[logSecs[Log[z]]]/60^2
>> hours[10^9]
>>
>> -16.0424 + 1.22792 z
>>
>> 3.37132
>>
>> Also note, omitting Update[] has NO effect on the timings:
>>
>> Timing[data =
>>    Table[Log@{#, First@Timing[N[Pi, #]]} &[2^k 10^5], {k, 1, 8}]]
>>
>> {231.703, {{Log[200000], -1.07002}, {Log[400000], -0.207024}, {Log[
>>      800000], 0.628609}, {Log[1600000], 1.52126}, {Log[3200000],
>>     2.36471}, {Log[6400000], 3.21133}, {Log[12800000],
>>     4.04989}, {Log[25600000], 4.8771}}}
>>
>> Bobby
>
> Update[] forces Mathematica to recalculate everything instead of using
> cached values. If it has no effect in Mathematica 6 that is very
> strange (it would mean that Mathematica 6 doesn't cache results in
> this case, and that the performance may be worse than in 5.2). Does it
> have an effect when you don't use it in Table[], but evaluate the
> expressions separately?
>
> In 5.2 it has a very noticeable effect:
>
> In[178]:=
> Update[]
>
> In[179]:=
> Timing[N[Pi,4*10^5];]
>
> Out[179]=
> {3.25 Second,Null}
>
> In[180]:=
> Timing[N[Pi,8*10^5];]
>
> Out[180]=
> {5.579 Second,Null}
>
> In[181]:=
> Update[]
>
> In[182]:=
> Timing[N[Pi,8*10^5];]
>
> Out[182]=
> {8.187 Second,Null}
>
> In[183]:=
> Update[]
>
> In[184]:=
> Table[Timing[N[Pi,k 4*10^5];],{k,2}]
>
> Out[184]=
> {{3.156 Second,Null},{5.625 Second,Null}}
>
> In[185]:=
> Update[]
>
> In[186]:=
> Table[Update[];Timing[N[Pi,k 4*10^5];],{k,2}]
>
> Out[186]=
> {{3.11 Second,Null},{8.062 Second,Null}}
>
> Szabolcs
>



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: Re: Re: Fourier and InverseFourier
  • Next by Date: Re: Re: Pi upto a Billion Digits
  • Previous by thread: Re: Re: Pi upto a Billion Digits
  • Next by thread: Re: Re: Pi upto a Billion Digits