MathGroup Archive 2003

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

Search the Archive

Re: Speed improvements in Mathematica 5 ??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42430] Re: Speed improvements in Mathematica 5 ??
  • From: "Dana DeLouis" <delouis at bellsouth.net>
  • Date: Mon, 7 Jul 2003 03:05:56 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I am new at this, but I was getting a feel for ver 5 by looking at old
Mathematica articles that had the word "bug" in it.

I came across one article where the consensus was that the following
"simple" integral was giving wrong output.

I do not know what the correct solution is, but it is interesting that
ver 5 takes me about 4.5 minutes to solve.  Apparently, (I think) it was
much faster earlier.

It generates a very long list of If conditions.  I think it is trying to
be more correct, but I am not sure.  I have to look carefully to find
the answer in the full-page mess.

 

On[ShowTime]

 

Integrate[Log[(x - s)^2 + (y + 1)^2], {s, -1, 0}]

 

254.225*Second

 

If[((Im[x]*Im[y] + Re[x] + 

       Re[x]*Re[y])/

      (1 + Re[y]) >= 0 || 

    (Im[x]*Im[y] + (1 + Re[x])*

        (1 + Re[y]))/

      (1 + Re[y]) <= 0 || 

    Re[y] == -1 && 

     Im[x]*Im[y] + (1 + Re[x])*

        (1 + Re[y]) != 0) && 

   (Sqrt[-(1 + y)^2] == x || 

    Sqrt[-(1 + y)^2] == 

     1 + x || 

    Im[x] - Im[Sqrt[

        -(1 + y)^2]] != 0 || 

..Long list cut..etc

 

If I make use of the new $Assumptions, I get about half a minute speed
increase.

 

$Assumptions[{Elements[{x, y},Reals]}]

 

Integrate[Log[(x - s)^2 + (y + 1)^2], {s, -1, 0}]

 

227.447*Second

 

If[((Im[x]*Im[y] + Re[x] + 

       Re[x]*Re[y])/

      (1 + Re[y]) >= 0 || 

    (Im[x]*Im[y] + (1 + Re[x])*

        (1 + Re[y]))/

      (1 + Re[y]) <= 0 || 

    Re[y] == -1 && 

     Im[x]*Im[y] + 

 

.etc

 

Can anyone explain the following if you use $Assumption to specify that
x and y are Reals?

Why does Mathematica spend so much time generating output like
Im[x]*Im[y], or Re[x], Re[y], etc when one already told it that x & y
are Reals?

Im[x] should be zero, and Re[x] should just be x. (I think).  Do you
think this could be adding to some of the observed slowdown?

 


Dana DeLouis
Windows XP
Mathematica $VersionNumber -> 5.0 for Microsoft Windows (June 10, 2003)

delouis at bellsouth.net
= = = = = = = = = = = = = = = = = 

 

"Axel Kowald" <kowald at molgen.mpg.de> wrote in message
news:be5u0e$jg1$1 at smc.vnet.net...

> Hello everybody,
> 
> I just downloaded the demoversion of Mathematica 5 and tried to find
the 
> advertised speed improvements. I got a benchmark notebook from 
> http://smc.vnet.net/timings40.html and run it on my old Mathematica
4.1 and the 
> new Mathematica 5 on the same machine (1.8GHz, win2k, 768MB RAM).
> 
> To my surprise Mathematica 5 was only 1.6% better than the 4.1 version
!!
> 
> Any comments ?
> 
> 
>                   Axel Kowald
>




  • Prev by Date: Re: NDSolve problem
  • Next by Date: WeibullDistribution
  • Previous by thread: Re: Re: Speed improvements in Mathematica 5 ??
  • Next by thread: Re: Speed improvements in Mathematica 5 ??