Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11347 > unrolled thread

V8 slow like a snail

Started by"Dr. Wolfgang Hintze" <weh@snafu.de>
First post2012-08-15 07:32 +0000
Last post2012-08-22 07:54 +0000
Articles 11 — 5 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  V8 slow like a snail "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-08-15 07:32 +0000
    Re: V8 slow like a snail "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-08-15 09:42 +0000
    Re: V8 slow like a snail Roland Franzius <roland.franzius@uos.de> - 2012-08-15 09:42 +0000
      Re: V8 slow like a snail "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-08-16 06:06 +0000
        Re: V8 slow like a snail Roland Franzius <roland.franzius@uos.de> - 2012-08-18 07:57 +0000
      Re: V8 slow like a snail "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-08-21 01:39 +0000
        Re: V8 slow like a snail Roland Franzius <roland.franzius@uos.de> - 2012-08-21 09:02 +0000
    Re: V8 slow like a snail "Alexey Popkov" <lehin.p@gmail.com> - 2012-08-17 07:44 +0000
    Re: V8 slow like a snail David Bailey <dave@removedbailey.co.uk> - 2012-08-20 08:14 +0000
    Re: V8 slow like a snail Andrzej Kozlowski <akozlowski@gmail.com> - 2012-08-21 01:28 +0000
    Re: V8 slow like a snail "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-08-22 07:54 +0000

#11347 — V8 slow like a snail

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2012-08-15 07:32 +0000
SubjectV8 slow like a snail
Message-ID<k0fjaj$q71$1@smc.vnet.net>
Great disappointment on my side with 8.0.4.0 Home edition which I
installed yesterday!
My first impression: looks good, many nice features ... but incredibly
slow in comparision to my good old 5.2.
I then carried out a modest benchmark test the results of which I'll
show below and which I like to express in terms of a "snail
factor" ( = time in v5.2/ time in v8).

Consider this integral for which we can safely expect Mathematica to
be expert in solving:

f1[n_, m_] :=
 Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
  Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]

I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
are the results in the format

{m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
call, snail factor first call, snail factor second call}

{
{ 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
{ 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
{ 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
{ 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
{10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
}

Even if we compare only the first calls the range of the snail factor
goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
larger m.

This is my story in other words: I own a very old car, and have
considered for a long time to change to a newer one - although it
still can go at 200 km/h on the Autobahn.
So now I am proud owner of the new brilliant car, and I must learn the
on important tours (m=1) =EDts maximum speed turns out to be less than 1
km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
not! Obviously I'll definitely keep the old car!

Ok, maybe I have chosen the wrong example (though in other test runs a
similar pictures emerged and this example is just the type I'm using
Mathematica for). Are there perhaps acknowleged benchmarks for such a
comparison of versions?

Finally, dear group, as you might have noticed, I'm asking for
consolation. Please comment and give me useful hints. Many thanks in
advance.

Best regards,
Wolfgang

[toc] | [next] | [standalone]


#11365

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2012-08-15 09:42 +0000
Message-ID<k0fqte$r05$1@smc.vnet.net>
In reply to#11347
On 15 Aug., 09:32, "Dr. Wolfgang Hintze" <w...@snafu.de> wrote:
> Great disappointment on my side with 8.0.4.0 Home edition which I
> installed yesterday!
> My first impression: looks good, many nice features ... but incredibly
> slow in comparision to my good old 5.2.
> I then carried out a modest benchmark test the results of which I'll
> show below and which I like to express in terms of a "snail
> factor" ( = time in v5.2/ time in v8).
>
> Consider this integral for which we can safely expect Mathematica to
> be expert in solving:
>
> f1[n_, m_] :=
>  Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>   Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>
> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
> are the results in the format
>
> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> call, snail factor first call, snail factor second call}
>
> {
> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
>
> }
>
> Even if we compare only the first calls the range of the snail factor
> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
> larger m.
>
> This is my story in other words: I own a very old car, and have
> considered for a long time to change to a newer one - although it
> still can go at 200 km/h on the Autobahn.
> So now I am proud owner of the new brilliant car, and I must learn the
> on important tours (m=1) =EDts maximum speed turns out to be less than 1
> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> not! Obviously I'll definitely keep the old car!
>
> Ok, maybe I have chosen the wrong example (though in other test runs a
> similar pictures emerged and this example is just the type I'm using
> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> comparison of versions?
>
> Finally, dear group, as you might have noticed, I'm asking for
> consolation. Please comment and give me useful hints. Many thanks in
> advance.
>
> Best regards,
> Wolfgang
>
>

Important correction: the snail factor is of course defined as
s = time in V8 / time in V5.2
Regards,
Wolfgang

[toc] | [prev] | [next] | [standalone]


#11366

FromRoland Franzius <roland.franzius@uos.de>
Date2012-08-15 09:42 +0000
Message-ID<k0fqto$r07$1@smc.vnet.net>
In reply to#11347
Am 15.08.2012 09:32, schrieb Dr. Wolfgang Hintze:
> Great disappointment on my side with 8.0.4.0 Home edition which I
> installed yesterday!
> My first impression: looks good, many nice features ... but incredibly
> slow in comparision to my good old 5.2.
> I then carried out a modest benchmark test the results of which I'll
> show below and which I like to express in terms of a "snail
> factor" ( = time in v5.2/ time in v8).
>
> Consider this integral for which we can safely expect Mathematica to
> be expert in solving:
>
> f1[n_, m_] :=
>   Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>    Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>
> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
> are the results in the format
>
> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> call, snail factor first call, snail factor second call}
>
> {
> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> }
>
> Even if we compare only the first calls the range of the snail factor
> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
> larger m.
>
> This is my story in other words: I own a very old car, and have
> considered for a long time to change to a newer one - although it
> still can go at 200 km/h on the Autobahn.
> So now I am proud owner of the new brilliant car, and I must learn the
> on important tours (m=1) =EDts maximum speed turns out to be less than 1
> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> not! Obviously I'll definitely keep the old car!
>
> Ok, maybe I have chosen the wrong example (though in other test runs a
> similar pictures emerged and this example is just the type I'm using
> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> comparison of versions?
>
> Finally, dear group, as you might have noticed, I'm asking for
> consolation. Please comment and give me useful hints. Many thanks in
> advance.

It is a good idea, to split seaching solutions and simplifying the 
solutions. In this very special case the indefinite integrals produce 
series of hypergeometric functions of n terms in 1/10 of a second.

And now vs 8 Simplifies this rather trival result for the definite case 
on {t,0,oo} into sums of polygammas.

Of course, nobody can foresee the results of additional simplification 
rules in case of special algebraic expressions. This happens with each 
new version. More simplification rules, more time.

My hope is that Wolfram at some point may give much more open control 
over implicit function simplification to his mathematical skilled users.

  This is already a problem in trigonometric simpilfications. A simple 
body of explicit rules choosen from the appropriate chapters of a 
standard formula website would be much more usable than the obscure 
dependency on an universal body of rules and an algorithm depending on 
time and leafcount. I completely stopped using Sin&Co and I am now 
writing all formulas in sin and cos and 1/sin  and feed the 
simplification rules by hand. Saves hours of computation time.

The same is true for the superflous work that has to be done in order to 
get an expression grouped in a conventional way readable for Mathematica 
non-experts.

-- 

Roland Franzius




[toc] | [prev] | [next] | [standalone]


#11374

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2012-08-16 06:06 +0000
Message-ID<k0i2lb$1cd$1@smc.vnet.net>
In reply to#11366
On 15 Aug., 11:42, Roland Franzius <roland.franz...@uos.de> wrote:
> Am 15.08.2012 09:32, schrieb Dr. Wolfgang Hintze:
>
>
>
>
>
> > Great disappointment on my side with 8.0.4.0 Home edition which I
> > installed yesterday!
> > My first impression: looks good, many nice features ... but incredibly
> > slow in comparision to my good old 5.2.
> > I then carried out a modest benchmark test the results of which I'll
> > show below and which I like to express in terms of a "snail
> > factor" ( = time in v5.2/ time in v8).
>
> > Consider this integral for which we can safely expect Mathematica to
> > be expert in solving:
>
> > f1[n_, m_] :=
> >   Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]}=
,
> >    Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>
> > I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Her=
e
> > are the results in the format
>
> > {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> > call, snail factor first call, snail factor second call}
>
> > {
> > { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> > { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> > { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> > { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> > {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> > }
>
> > Even if we compare only the first calls the range of the snail factor
> > goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 f=
or
> > larger m.
>
> > This is my story in other words: I own a very old car, and have
> > considered for a long time to change to a newer one - although it
> > still can go at 200 km/h on the Autobahn.
> > So now I am proud owner of the new brilliant car, and I must learn the
> > on important tours (m=1) =EDts maximum speed turns out to be less t=
han 1
> > km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> > not! Obviously I'll definitely keep the old car!
>
> > Ok, maybe I have chosen the wrong example (though in other test runs a
> > similar pictures emerged and this example is just the type I'm using
> > Mathematica for). Are there perhaps acknowleged benchmarks for such a
> > comparison of versions?
>
> > Finally, dear group, as you might have noticed, I'm asking for
> > consolation. Please comment and give me useful hints. Many thanks in
> > advance.
>
> It is a good idea, to split seaching solutions and simplifying the
> solutions. In this very special case the indefinite integrals produce
> series of hypergeometric functions of n terms in 1/10 of a second.
>
> And now vs 8 Simplifies this rather trival result for the definite case
> on {t,0,oo} into sums of polygammas.
>
> Of course, nobody can foresee the results of additional simplification
> rules in case of special algebraic expressions. This happens with each
> new version. More simplification rules, more time.
>
> My hope is that Wolfram at some point may give much more open control
> over implicit function simplification to his mathematical skilled users.
>
>   This is already a problem in trigonometric simpilfications. A simple
> body of explicit rules choosen from the appropriate chapters of a
> standard formula website would be much more usable than the obscure
> dependency on an universal body of rules and an algorithm depending on
> time and leafcount. I completely stopped using Sin&Co and I am now
> writing all formulas in sin and cos and 1/sin  and feed the
> simplification rules by hand. Saves hours of computation time.
>
> The same is true for the superflous work that has to be done in order to
> get an expression grouped in a conventional way readable for Mathematica
> non-experts.
>
> --
>
> Roland Franzius
>
>

The problem is not the simplification but the basic calculation of an
integral.
Here are two striking examples:

Example 1
~~~~~~~~~
v 8
Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
Infinity}]]
{30.840999999999994, ConditionalExpression[HarmonicNumber[n], Re[n] >
-1]}

v 5.2:
Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
Infinity}]]
{0.53*Second, n*If[Re[n] > -1, HarmonicNumber[n]/n,
    Integrate[((-1 + E^t)^(-1 + n)*t)/E^(n*t), {t, 0, Infinity},
Assumptions -> Re[n] <= -1]]}

Snail factor s = 30.8/0.53 ~= 60

Example 2
~~~~~~~~~
v 8 without Simplify
Timing[f = Integrate[Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]],
       {x, Pi/3, Pi/2}]]

{656.4209999999998,
 Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(-Sqrt[7] + Tan[x])]],
     {x, Pi/3, Pi/2}]}

No result at all in more than 10 minutes!
Therefore I tried FullSimplify in order to get at least a result.

v 8 with FullSimplify
Timing[f = FullSimplify[Integrate[
         Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x, Pi/3,
     Pi/2}]]]

Out[1]= {3191.391,
 Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(Sqrt[7] - Tan[x])]],
     {x, Pi/3, Pi/2}]}

Again, no result, but now it took almost 1 hour of "thinking".

Now v 5.2
Timing[f = FullSimplify[Integrate[
     Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x, Pi/3, Pi/
2}]]]
{32.667*Second, (1*(-9*ArcCot[Sqrt[7]]*Log[2] - (Pi -
6*ArcCot[Sqrt[7]])*
      Log[-Sqrt[3] + Sqrt[7]] + Pi*Log[Sqrt[3] + Sqrt[7]] +
     3*I*(-PolyLog[2, (-Sqrt[3] + Sqrt[7])/(-I + Sqrt[7])] +
       PolyLog[2, (-Sqrt[3] + Sqrt[7])/(I + Sqrt[7])] +
       PolyLog[2, (-I + Sqrt[7])/(Sqrt[3] + Sqrt[7])] -
       PolyLog[2, (I + Sqrt[7])/(Sqrt[3] + Sqrt[7])])))/6}

Oops, half a minute and here we are with the result !

Snail factor s = oo (because no solution was found) or s = 3191/32.7
~= 100 (if we count the times of "absense" for v8).

Is it exagerated to speak of a disaster?

Regards,
Wolfgang

[toc] | [prev] | [next] | [standalone]


#11413

FromRoland Franzius <roland.franzius@uos.de>
Date2012-08-18 07:57 +0000
Message-ID<k0nhtc$b3b$1@smc.vnet.net>
In reply to#11374
Am 16.08.2012 08:06, schrieb Dr. Wolfgang Hintze:
> On 15 Aug., 11:42, Roland Franzius <roland.franz...@uos.de> wrote:
>> Am 15.08.2012 09:32, schrieb Dr. Wolfgang Hintze:
>>
>>
>>
>>
>>
>>> Great disappointment on my side with 8.0.4.0 Home edition which I
>>> installed yesterday!
>>> My first impression: looks good, many nice features ... but incredibly
>>> slow in comparision to my good old 5.2.
>>> I then carried out a modest benchmark test the results of which I'll
>>> show below and which I like to express in terms of a "snail
>>> factor" ( = time in v5.2/ time in v8).
>>
>>> Consider this integral for which we can safely expect Mathematica to
>>> be expert in solving:
>>
>>> f1[n_, m_] :=
>>>    Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>>>     Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>>
>>> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
>>> are the results in the format
>>
>>> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
>>> call, snail factor first call, snail factor second call}
>>
>>> {
>>> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
>>> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
>>> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
>>> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
>>> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
>>> }
>>
>>> Even if we compare only the first calls the range of the snail factor
>>> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
>>> larger m.
>>
>>> This is my story in other words: I own a very old car, and have
>>> considered for a long time to change to a newer one - although it
>>> still can go at 200 km/h on the Autobahn.
>>> So now I am proud owner of the new brilliant car, and I must learn the
>>> on important tours (m=1) =EDts maximum speed turns out to be less than 1
>>> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
>>> not! Obviously I'll definitely keep the old car!
>>
>>> Ok, maybe I have chosen the wrong example (though in other test runs a
>>> similar pictures emerged and this example is just the type I'm using
>>> Mathematica for). Are there perhaps acknowleged benchmarks for such a
>>> comparison of versions?
>>
>>> Finally, dear group, as you might have noticed, I'm asking for
>>> consolation. Please comment and give me useful hints. Many thanks in
>>> advance.
>>
>> It is a good idea, to split seaching solutions and simplifying the
>> solutions. In this very special case the indefinite integrals produce
>> series of hypergeometric functions of n terms in 1/10 of a second.
>>
>> And now vs 8 Simplifies this rather trival result for the definite case
>> on {t,0,oo} into sums of polygammas.
>>
>> Of course, nobody can foresee the results of additional simplification
>> rules in case of special algebraic expressions. This happens with each
>> new version. More simplification rules, more time.
>>
>> My hope is that Wolfram at some point may give much more open control
>> over implicit function simplification to his mathematical skilled users.
>>
>>    This is already a problem in trigonometric simpilfications. A simple
>> body of explicit rules choosen from the appropriate chapters of a
>> standard formula website would be much more usable than the obscure
>> dependency on an universal body of rules and an algorithm depending on
>> time and leafcount. I completely stopped using Sin&Co and I am now
>> writing all formulas in sin and cos and 1/sin  and feed the
>> simplification rules by hand. Saves hours of computation time.
>>
>> The same is true for the superflous work that has to be done in order to
>> get an expression grouped in a conventional way readable for Mathematica
>> non-experts.
>>
>> --
>>
>> Roland Franzius
>>
>>
>
> The problem is not the simplification but the basic calculation of an
> integral.
> Here are two striking examples:
>
> Example 1
> ~~~~~~~~~
> v 8
> Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
> Infinity}]]
> {30.840999999999994, ConditionalExpression[HarmonicNumber[n], Re[n] >
> -1]}
>
> v 5.2:
> Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
> Infinity}]]
> {0.53*Second, n*If[Re[n] > -1, HarmonicNumber[n]/n,
>      Integrate[((-1 + E^t)^(-1 + n)*t)/E^(n*t), {t, 0, Infinity},
> Assumptions -> Re[n] <= -1]]}
>
> Snail factor s = 30.8/0.53 ~= 60
>
> Example 2
> ~~~~~~~~~
> v 8 without Simplify
> Timing[f = Integrate[Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]],
>         {x, Pi/3, Pi/2}]]
>
> {656.4209999999998,
>   Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(-Sqrt[7] + Tan[x])]],
>       {x, Pi/3, Pi/2}]}
>
> No result at all in more than 10 minutes!
> Therefore I tried FullSimplify in order to get at least a result.
>
> v 8 with FullSimplify
> Timing[f = FullSimplify[Integrate[
>           Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x, Pi/3,
>       Pi/2}]]]
>
> Out[1]= {3191.391,
>   Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(Sqrt[7] - Tan[x])]],
>       {x, Pi/3, Pi/2}]}
>
> Again, no result, but now it took almost 1 hour of "thinking".
>
> Now v 5.2
> Timing[f = FullSimplify[Integrate[
>       Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x, Pi/3, Pi/
> 2}]]]
> {32.667*Second, (1*(-9*ArcCot[Sqrt[7]]*Log[2] - (Pi -
> 6*ArcCot[Sqrt[7]])*
>        Log[-Sqrt[3] + Sqrt[7]] + Pi*Log[Sqrt[3] + Sqrt[7]] +
>       3*I*(-PolyLog[2, (-Sqrt[3] + Sqrt[7])/(-I + Sqrt[7])] +
>         PolyLog[2, (-Sqrt[3] + Sqrt[7])/(I + Sqrt[7])] +
>         PolyLog[2, (-I + Sqrt[7])/(Sqrt[3] + Sqrt[7])] -
>         PolyLog[2, (I + Sqrt[7])/(Sqrt[3] + Sqrt[7])])))/6}
>
> Oops, half a minute and here we are with the result !
>
> Snail factor s = oo (because no solution was found) or s = 3191/32.7
> ~= 100 (if we count the times of "absense" for v8).
>
> Is it exagerated to speak of a disaster?

As an integrator frontend you may be right.

But compare your results with thos after the standard substitution

exp(-t) ->u, t->-Log[u], dt -> -du/u  {t,0,oo}-> {u,0,1}

h1[n_, m_] :=
  Integrate[n (-Log[u])^m  (1 - u)^(n - 1), {u, 0, 1},
   Assumptions -> {{n} \[Element] Integers, n > 0}]

Parallelize[
Timing[h1[n, #]] & /@ {0, 1, 2, 3, 10}]
{{0.40500000000000114`, 1},
{0.6549999999999869`,   HarmonicNumber[n]},
{0.7959999999999994`, \[Pi]^2/6 +    HarmonicNumber[n]^2 - PolyGamma[1, 
1 + n]},
{1.622000000000007`,    HarmonicNumber[n]^3 +   1/2 HarmonicNumber[n] 
(\[Pi]^2 - 6 PolyGamma[1, 1 + n]) +    PolyGamma[2, 1 + n] + 2 Zeta[3]},
{10.`,   1/352 (352 EulerGamma^10 + 2640 EulerGamma^8 \[Pi]^2 +


..... some 400 lines

              1 + n] (20 EulerGamma^4 + 20 EulerGamma^2 \[Pi]^2 +
               3 \[Pi]^4 - 20 PolyGamma[3, 1 + n] +
               160 EulerGamma Zeta[3]) + 12096 EulerGamma^2 Zeta[5] +
            2016 \[Pi]^2 Zeta[5] + 17280 Zeta[7]) + 3225600 Zeta[9]))}}


In most cases, the problems consuming the life time of young scientists, 
are inappropriate programming models.

Playing around with Mathematica and applying  the worlds knowledge about 
equivalence classes of mathematical problems may possibly save years of 
CPU time and GBs of additional memory.

-- 

Roland Franzius

[toc] | [prev] | [next] | [standalone]


#11433

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2012-08-21 01:39 +0000
Message-ID<k0uos9$n7l$1@smc.vnet.net>
In reply to#11366
On 18 Aug., 09:57, Roland Franzius <roland.franz...@uos.de> wrote:
> Am 16.08.2012 08:06, schrieb Dr. Wolfgang Hintze:
>
>
>
>
>
> > On 15 Aug., 11:42, Roland Franzius <roland.franz...@uos.de> wrote:
> >> Am 15.08.2012 09:32, schrieb Dr. Wolfgang Hintze:
>
> >>> Great disappointment on my side with 8.0.4.0 Home edition which I
> >>> installed yesterday!
> >>> My first impression: looks good, many nice features ... but incredibl=
y
> >>> slow in comparision to my good old 5.2.
> >>> I then carried out a modest benchmark test the results of which I'll
> >>> show below and which I like to express in terms of a "snail
> >>> factor" ( = time in v5.2/ time in v8).
>
> >>> Consider this integral for which we can safely expect Mathematica to
> >>> be expert in solving:
>
> >>> f1[n_, m_] :=
> >>>    Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infin=
ity]},
> >>>     Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>
> >>> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. H=
ere
> >>> are the results in the format
>
> >>> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> >>> call, snail factor first call, snail factor second call}
>
> >>> {
> >>> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> >>> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> >>> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> >>> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> >>> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> >>> }
>
> >>> Even if we compare only the first calls the range of the snail factor
> >>> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8=
 for
> >>> larger m.
>
> >>> This is my story in other words: I own a very old car, and have
> >>> considered for a long time to change to a newer one - although it
> >>> still can go at 200 km/h on the Autobahn.
> >>> So now I am proud owner of the new brilliant car, and I must learn th=
e
> >>> on important tours (m=1) =EDts maximum speed turns out to be less=
 than 1
> >>> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? =
Me
> >>> not! Obviously I'll definitely keep the old car!
>
> >>> Ok, maybe I have chosen the wrong example (though in other test runs =
a
> >>> similar pictures emerged and this example is just the type I'm using
> >>> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> >>> comparison of versions?
>
> >>> Finally, dear group, as you might have noticed, I'm asking for
> >>> consolation. Please comment and give me useful hints. Many thanks in
> >>> advance.
>
> >> It is a good idea, to split seaching solutions and simplifying the
> >> solutions. In this very special case the indefinite integrals produce
> >> series of hypergeometric functions of n terms in 1/10 of a second.
>
> >> And now vs 8 Simplifies this rather trival result for the definite cas=
e
> >> on {t,0,oo} into sums of polygammas.
>
> >> Of course, nobody can foresee the results of additional simplification
> >> rules in case of special algebraic expressions. This happens with each
> >> new version. More simplification rules, more time.
>
> >> My hope is that Wolfram at some point may give much more open control
> >> over implicit function simplification to his mathematical skilled user=
s.
>
> >>    This is already a problem in trigonometric simpilfications. A s=
imple
> >> body of explicit rules choosen from the appropriate chapters of a
> >> standard formula website would be much more usable than the obscure
> >> dependency on an universal body of rules and an algorithm depending on
> >> time and leafcount. I completely stopped using Sin&Co and I am now
> >> writing all formulas in sin and cos and 1/sin  and feed the
> >> simplification rules by hand. Saves hours of computation time.
>
> >> The same is true for the superflous work that has to be done in order =
to
> >> get an expression grouped in a conventional way readable for Mathemati=
ca
> >> non-experts.
>
> >> --
>
> >> Roland Franzius
>
> > The problem is not the simplification but the basic calculation of an
> > integral.
> > Here are two striking examples:
>
> > Example 1
> > ~~~~~~~~~
> > v 8
> > Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
> > Infinity}]]
> > {30.840999999999994, ConditionalExpression[HarmonicNumber[n], Re[n] >
> > -1]}
>
> > v 5.2:
> > Timing[Integrate[n*t*Exp[(-n)*t]*(Exp[t] - 1)^(n - 1), {t, 0,
> > Infinity}]]
> > {0.53*Second, n*If[Re[n] > -1, HarmonicNumber[n]/n,
> >      Integrate[((-1 + E^t)^(-1 + n)*t)/E^(n*t), {t, 0, Infinity},
> > Assumptions -> Re[n] <= -1]]}
>
> > Snail factor s = 30.8/0.53 ~= 60
>
> > Example 2
> > ~~~~~~~~~
> > v 8 without Simplify
> > Timing[f = Integrate[Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]],
> >         {x, Pi/3, Pi/2}]]
>
> > {656.4209999999998,
> >   Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(-Sqrt[7] + Tan[x])]],
> >       {x, Pi/3, Pi/2}]}
>
> > No result at all in more than 10 minutes!
> > Therefore I tried FullSimplify in order to get at least a result.
>
> > v 8 with FullSimplify
> > Timing[f = FullSimplify[Integrate[
> >           Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x=
, Pi/3,
> >       Pi/2}]]]
>
> > Out[1]= {3191.391,
> >   Integrate[Log[Abs[(Sqrt[7] + Tan[x])/(Sqrt[7] - Tan[x])]],
> >       {x, Pi/3, Pi/2}]}
>
> > Again, no result, but now it took almost 1 hour of "thinking".
>
> > Now v 5.2
> > Timing[f = FullSimplify[Integrate[
> >       Log[Abs[(Tan[x] + Sqrt[7])/(Tan[x] - Sqrt[7])]], {x, Pi/3, =
Pi/
> > 2}]]]
> > {32.667*Second, (1*(-9*ArcCot[Sqrt[7]]*Log[2] - (Pi -
> > 6*ArcCot[Sqrt[7]])*
> >        Log[-Sqrt[3] + Sqrt[7]] + Pi*Log[Sqrt[3] + Sqrt[7]] +
> >       3*I*(-PolyLog[2, (-Sqrt[3] + Sqrt[7])/(-I + Sqrt[7])] +
> >         PolyLog[2, (-Sqrt[3] + Sqrt[7])/(I + Sqrt[7])] +
> >         PolyLog[2, (-I + Sqrt[7])/(Sqrt[3] + Sqrt[7])] -
> >         PolyLog[2, (I + Sqrt[7])/(Sqrt[3] + Sqrt[7])])))/6}
>
> > Oops, half a minute and here we are with the result !
>
> > Snail factor s = oo (because no solution was found) or s = 3191/32.=
7
> > ~= 100 (if we count the times of "absense" for v8).
>
> > Is it exagerated to speak of a disaster?
>
> As an integrator frontend you may be right.
>
> But compare your results with thos after the standard substitution
>
> exp(-t) ->u, t->-Log[u], dt -> -du/u  {t,0,oo}-> {u,0,1}
>
> h1[n_, m_] :=
>   Integrate[n (-Log[u])^m  (1 - u)^(n - 1), {u, 0, 1},
>    Assumptions -> {{n} \[Element] Integers, n > 0}]
>
> Parallelize[
> Timing[h1[n, #]] & /@ {0, 1, 2, 3, 10}]
> {{0.40500000000000114`, 1},
> {0.6549999999999869`,   HarmonicNumber[n]},
> {0.7959999999999994`, \[Pi]^2/6 +    HarmonicNumber[n]^2 - PolyGamma[=
1,
> 1 + n]},
> {1.622000000000007`,    HarmonicNumber[n]^3 +   1/2 HarmonicNumber[=
n]
> (\[Pi]^2 - 6 PolyGamma[1, 1 + n]) +    PolyGamma[2, 1 + n] + 2 Zeta[3=
]},
> {10.`,   1/352 (352 EulerGamma^10 + 2640 EulerGamma^8 \[Pi]^2 +
>
> ..... some 400 lines
>
>               1 + n] (20 EulerGamma^4 + 20 EulerGamma^2 \[P=
i]^2 +
>                3 \[Pi]^4 - 20 PolyGamma[3, 1 + n] +
>                160 EulerGamma Zeta[3]) + 12096 EulerGamma=
^2 Zeta[5] +
>             2016 \[Pi]^2 Zeta[5] + 17280 Zeta[7]) + 3225600 Z=
eta[9]))}}
>
> In most cases, the problems consuming the life time of young scientists,
> are inappropriate programming models.
>
> Playing around with Mathematica and applying  the worlds knowledge abou=
t
> equivalence classes of mathematical problems may possibly save years of
> CPU time and GBs of additional memory.
>
> --
>
> Roland Franzius
>
>

I'm well aware of how to handle Mathematica i.e. to help it get to
results (since 2003 in this group).
However, as a conservative software user this was my first version
change in Mathematica, and I didn't expect the differences be so grave
when simply comparing the same commands.

Your substitution is so obvious that exactly for this reason one could
possibly expect Mathematica to do it by itself. But ok, in this form
the integration in V8 is quick.

And after all, one of the charming features of Mathematica is just the
"human-like" behaviour to sometimes failing but with some help finally
reaching the goal.

Regards,
Wolfgang

[toc] | [prev] | [next] | [standalone]


#11436

FromRoland Franzius <roland.franzius@uos.de>
Date2012-08-21 09:02 +0000
Message-ID<k0vir2$oun$1@smc.vnet.net>
In reply to#11433
Am 21.08.2012 03:39, schrieb Dr. Wolfgang Hintze:

>>>>> Consider this integral for which we can safely expect Mathematica to
>>>>> be expert in solving:
>>
>>>>> f1[n_, m_] :=
>>>>>     Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infin=
> ity]},
>>>>>      Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>>
>>>>> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. H=
> ere
>>>>> are the results in the format

>> But compare your results with thos after the standard substitution
>>
>> exp(-t) ->u, t->-Log[u], dt -> -du/u  {t,0,oo}-> {u,0,1}
>>
>> h1[n_, m_] :=
>>    Integrate[n (-Log[u])^m  (1 - u)^(n - 1), {u, 0, 1},
>>     Assumptions -> {{n} \[Element] Integers, n > 0}]

>
> I'm well aware of how to handle Mathematica i.e. to help it get to
> results (since 2003 in this group).
> However, as a conservative software user this was my first version
> change in Mathematica, and I didn't expect the differences be so grave
> when simply comparing the same commands.
>
> Your substitution is so obvious that exactly for this reason one could
> possibly expect Mathematica to do it by itself. But ok, in this form
> the integration in V8 is quick.
>
> And after all, one of the charming features of Mathematica is just the
> "human-like" behaviour to sometimes failing but with some help finally
> reaching the goal.

At least you found a real bug in vs 8.

Mathematica uses generalized hypergeometric series to express a wide 
class of integrals containing Pochhammer symbols wich arise in partial 
integration of expression(x)^n.
But some of these series dont work for integer parameters or need 
special regularizations by Gamma factors.

In this case the indefinite integrals over the variable t are expressed 
in terms of

HypergeometricPFQ[{-n,-n...},{1-n,1-n,...},, e^t]

Mathematica is not able to determine Limits for t->0 and t->oo. Moreover 
these special hypergeometric series even seem to have no limits for 
integer n.

So I suspect the time is vasted for determining the limits for real 
noninteger n (Limit takes some 50-100 seconds to retun no result) and 
after failing the standard substituition list is applied.

The general integration rule complex for "algebraic expression of powers 
and exponentials" seems to miss a preprocessing for the exception of 
integer n and m.

--

Roland Franzius

[toc] | [prev] | [next] | [standalone]


#11387

From"Alexey Popkov" <lehin.p@gmail.com>
Date2012-08-17 07:44 +0000
Message-ID<k0kspc$66t$1@smc.vnet.net>
In reply to#11347
"Dr. Wolfgang Hintze" <weh@snafu.de> сообщил/сообщила в новостях следующее: 
news:k0fjaj$q71$1@smc.vnet.net...
> Great disappointment on my side with 8.0.4.0 Home edition which I
> installed yesterday!
> My first impression: looks good, many nice features ... but incredibly
> slow in comparision to my good old 5.2.
> I then carried out a modest benchmark test the results of which I'll
> show below and which I like to express in terms of a "snail
> factor" ( = time in v5.2/ time in v8).
>
> Consider this integral for which we can safely expect Mathematica to
> be expert in solving:
>
> f1[n_, m_] :=
> Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>  Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>
> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
> are the results in the format
>
> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> call, snail factor first call, snail factor second call}
>
> {
> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> }
>
> Even if we compare only the first calls the range of the snail factor
> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
> larger m.
>
> This is my story in other words: I own a very old car, and have
> considered for a long time to change to a newer one - although it
> still can go at 200 km/h on the Autobahn.
> So now I am proud owner of the new brilliant car, and I must learn the
> on important tours (m=1) =EDts maximum speed turns out to be less than 1
> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> not! Obviously I'll definitely keep the old car!
>
> Ok, maybe I have chosen the wrong example (though in other test runs a
> similar pictures emerged and this example is just the type I'm using
> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> comparison of versions?
>
> Finally, dear group, as you might have noticed, I'm asking for
> consolation. Please comment and give me useful hints. Many thanks in
> advance.
>
> Best regards,
> Wolfgang
>

There is a way to use MathKernel of version 5.2 from the version 8 
transparently via MathLink. It is as easy as defining

f1[n_, m_] :=
krn5Eval[Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, 
\[Infinity]},
Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]]
(where krn5Eval[] is a function that transparently uses version 5 for 
evaluating its argument).

You can find more information in this thread:

http://stackoverflow.com/questions/4983301/executing-code-in-v-5-2-kernel-from-within-v-7-01-session-through-mathlink

HTH,

Alexey




[toc] | [prev] | [next] | [standalone]


#11419

FromDavid Bailey <dave@removedbailey.co.uk>
Date2012-08-20 08:14 +0000
Message-ID<k0srkb$jma$1@smc.vnet.net>
In reply to#11347
On 15/08/2012 08:32, Dr. Wolfgang Hintze wrote:
> Great disappointment on my side with 8.0.4.0 Home edition which I
> installed yesterday!
> My first impression: looks good, many nice features ... but incredibly
> slow in comparision to my good old 5.2.
> I then carried out a modest benchmark test the results of which I'll
> show below and which I like to express in terms of a "snail
> factor" ( = time in v5.2/ time in v8).
>
> Consider this integral for which we can safely expect Mathematica to
> be expert in solving:
>
> f1[n_, m_] :=
>   Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>    Assumptions ->  {{n, m} \[Element] Integers, m>= 0, n>  0}]
>
> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. Here
> are the results in the format
>
> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> call, snail factor first call, snail factor second call}
>
> {
> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> }
>
> Even if we compare only the first calls the range of the snail factor
> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
> larger m.
>
> This is my story in other words: I own a very old car, and have
> considered for a long time to change to a newer one - although it
> still can go at 200 km/h on the Autobahn.
> So now I am proud owner of the new brilliant car, and I must learn the
> on important tours (m=1) =EDts maximum speed turns out to be less than 1
> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> not! Obviously I'll definitely keep the old car!
>
> Ok, maybe I have chosen the wrong example (though in other test runs a
> similar pictures emerged and this example is just the type I'm using
> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> comparison of versions?
>
> Finally, dear group, as you might have noticed, I'm asking for
> consolation. Please comment and give me useful hints. Many thanks in
> advance.
>
> Best regards,
> Wolfgang
>

It is important to realise two things:

1)     The home edition is the same code as the normal version.

2)     The speed of Mathematica depends on what calculation you are 
interested in - many things have speed-ed up since 5.2. A lot of extra 
analysis was added to symbolic integrals (at v6.0) to ensure that the 
result was always valid. This slowed down symbolic integration 
(particularly definite integrals), but is presumably worth it. There is 
an option to Integrate that will stop at least some of this extra CPU 
time: GenerateConditions->False

David Bailey
http://www.dbaileyconsultancy.co.uk



[toc] | [prev] | [next] | [standalone]


#11423

FromAndrzej Kozlowski <akozlowski@gmail.com>
Date2012-08-21 01:28 +0000
Message-ID<k0uo74$n3i$1@smc.vnet.net>
In reply to#11347
On 20 Aug 2012, at 10:13, David Bailey <dave@removedbailey.co.uk> wrote:

> On 15/08/2012 08:32, Dr. Wolfgang Hintze wrote:
>> Great disappointment on my side with 8.0.4.0 Home edition which I
>> installed yesterday!
>> My first impression: looks good, many nice features ... but =
incredibly
>> slow in comparision to my good old 5.2.
>> I then carried out a modest benchmark test the results of which I'll
>> show below and which I like to express in terms of a "snail
>> factor" ( = time in v5.2/ time in v8).
>>
>> Consider this integral for which we can safely expect Mathematica to
>> be expert in solving:
>>
>> f1[n_, m_] :=
>>  Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
>>   Assumptions ->  {{n, m} \[Element] Integers, m>= 0, n>  0}]
>>
>> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. =
Here
>> are the results in the format
>>
>> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
>> call, snail factor first call, snail factor second call}
>>
>> {
>> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
>> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
>> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
>> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
>> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
>> }
>>
>> Even if we compare only the first calls the range of the snail factor
>> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 =
for
>> larger m.
>>
>> This is my story in other words: I own a very old car, and have
>> considered for a long time to change to a newer one - although it
>> still can go at 200 km/h on the Autobahn.
>> So now I am proud owner of the new brilliant car, and I must learn =
the
>> on important tours (m=1) =EDts maximum speed turns out to be less =
than 1
>> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
>> not! Obviously I'll definitely keep the old car!
>>
>> Ok, maybe I have chosen the wrong example (though in other test runs =
a
>> similar pictures emerged and this example is just the type I'm using
>> Mathematica for). Are there perhaps acknowleged benchmarks for such a
>> comparison of versions?
>>
>> Finally, dear group, as you might have noticed, I'm asking for
>> consolation. Please comment and give me useful hints. Many thanks in
>> advance.
>>
>> Best regards,
>> Wolfgang
>>
>
> It is important to realise two things:
>
> 1)     The home edition is the same code as the normal version.
>
> 2)     The speed of Mathematica depends on what calculation you are
> interested in - many things have speed-ed up since 5.2. A lot of extra=

> analysis was added to symbolic integrals (at v6.0) to ensure that the=

> result was always valid. This slowed down symbolic integration
> (particularly definite integrals), but is presumably worth it. There =
is
> an option to Integrate that will stop at least some of this extra CPU=

> time: GenerateConditions->False
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>
>
>
>

There is a third thing one should add to this. Improvements to functions 
like Integrate that usually consist of making sure that it only uses 
methods that always lead to valid answers sometimes (used to be quite 
often in the past) as a side effect result in Integrate not being able 
to obtain answers to problems that it used to give valid answers to 
before the new checks were introduced. There are a number of ways this 
could happen. The worst case is when it turns out that Mathematica got 
the old (correct) answer by applying a transformation that is invalid in 
general and just happened to work in this particular case. Probably more 
often the transformation that was applied was valid only for a narrower 
class of cases and in the newer version this class was restricted too 
far (thus excelling the case in question). In any case, it should be 
obvious to anyone that no one is trying to make Mathematica deliberately 
slower and that examples like this are almost certainly unfortunate 
"side effects" of genuine improvements.
It does not mean, of course, that such problems should not be fixed - 
they definitely should, but to claim that functions like Integrate have 
overall become less usable in higher version displays both ignorance of 
how such things work and lack of experience with the newer version 
(there are a vast number of integrals that version 8 can do that version 
5 can't or where version 5 gives wrong answers).

Andrzej Kozlowski

[toc] | [prev] | [next] | [standalone]


#11447

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2012-08-22 07:54 +0000
Message-ID<k1238f$eq$1@smc.vnet.net>
In reply to#11347
On 21 Aug., 03:28, Andrzej Kozlowski <akozlow...@gmail.com> wrote:
> On 20 Aug 2012, at 10:13, David Bailey <d...@removedbailey.co.uk> wrote:
>
>
>
>
>
>
>
>
>
> > On 15/08/2012 08:32, Dr. Wolfgang Hintze wrote:
> >> Great disappointment on my side with 8.0.4.0 Home edition which I
> >> installed yesterday!
> >> My first impression: looks good, many nice features ... but incredibly
> >> slow in comparision to my good old 5.2.
> >> I then carried out a modest benchmark test the results of which I'll
> >> show below and which I like to express in terms of a "snail
> >> factor" ( = time in v5.2/ time in v8).
>
> >> Consider this integral for which we can safely expect Mathematica to
> >> be expert in solving:
>
> >> f1[n_, m_] :=
> >>  Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infinity]},
> >>   Assumptions ->  {{n, m} \[Element] Integers, m>= 0, n>  0}]
>
> >> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. 
> Here
> >> are the results in the format
>
> >> {m, V5.2 f1 first call, V5.2 second call, V8 first call, V8 second
> >> call, snail factor first call, snail factor second call}
>
> >> {
> >> { 0, 0.328, 0.078, 2.122, 2.044, 6.46951, 26.2051},
> >> { 1, 0.109,  0.063, 30.202, 30.483, 277.083, 483.857},
> >> { 2, 0.421, 0.11,  30.42, 30.17, 72.2565, 274.273},
> >> { 3, 0.452, 0.156, 31.528, 31.325, 69.7522, 200.801},
> >> {10, 5.366, 5.382, 42.448, 42.682, 7.91055, 7.93051}
> >> }
>
> >> Even if we compare only the first calls the range of the snail factor
> >> goes up to 277 at m = 1, is 72 for m = 2, and is still close to 8 for
> >> larger m.
>
> >> This is my story in other words: I own a very old car, and have
> >> considered for a long time to change to a newer one - although it
> >> still can go at 200 km/h on the Autobahn.
> >> So now I am proud owner of the new brilliant car, and I must learn the
> >> on important tours (m=1) =EDts maximum speed turns out to be less 
> than 1
> >> km/h,  about 3 km/h (m=2) or at most about 30 km/h. Who laughes? Me
> >> not! Obviously I'll definitely keep the old car!
>
> >> Ok, maybe I have chosen the wrong example (though in other test runs a
> >> similar pictures emerged and this example is just the type I'm using
> >> Mathematica for). Are there perhaps acknowleged benchmarks for such a
> >> comparison of versions?
>
> >> Finally, dear group, as you might have noticed, I'm asking for
> >> consolation. Please comment and give me useful hints. Many thanks in
> >> advance.
>
> >> Best regards,
> >> Wolfgang
>
> > It is important to realise two things:
>
> > 1)     The home edition is the same code as the normal version.
>
> > 2)     The speed of Mathematica depends on what calculation you are
> > interested in - many things have speed-ed up since 5.2. A lot of extra analysis was added to symbolic integrals (at v6.0) to ensure that the result was always valid. This slowed down symbolic integration
> > (particularly definite integrals), but is presumably worth it. There is
> > an option to Integrate that will stop at least some of this extra CPU time: GenerateConditions->False
>
> > David Bailey
> >http://www.dbaileyconsultancy.co.uk
>
> There is a third thing one should add to this. Improvements to functions
> like Integrate that usually consist of making sure that it only uses
> methods that always lead to valid answers sometimes (used to be quite
> often in the past) as a side effect result in Integrate not being able
> to obtain answers to problems that it used to give valid answers to
> before the new checks were introduced. There are a number of ways this
> could happen. The worst case is when it turns out that Mathematica got
> the old (correct) answer by applying a transformation that is invalid in
> general and just happened to work in this particular case. Probably more
> often the transformation that was applied was valid only for a narrower
> class of cases and in the newer version this class was restricted too
> far (thus excelling the case in question). In any case, it should be
> obvious to anyone that no one is trying to make Mathematica deliberately
> slower and that examples like this are almost certainly unfortunate
> "side effects" of genuine improvements.
> It does not mean, of course, that such problems should not be fixed -
> they definitely should, but to claim that functions like Integrate have
> overall become less usable in higher version displays both ignorance of
> how such things work and lack of experience with the newer version
> (there are a vast number of integrals that version 8 can do that version
> 5 can't or where version 5 gives wrong answers).
>
> Andrzej Kozlowski
>
>

Thank you for the valuable and interesting comments to which I agree
completely, except for one point: I don't know of anybody claiming
that Integrate has become less usable in higher versions in general,
including myself. I just presented examples which surprised me.

The discussion in this group helped clarify much of the issue.

Best regards,
Wolfgang

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web