MathGroup Archive 1996

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

Search the Archive

Re: Slow ReIm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3405] Re: Slow ReIm
  • From: danl (Daniel Lichtblau)
  • Date: Mon, 4 Mar 1996 02:35:05 -0500
  • Organization: Wolfram Research, Inc.
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4h13tr$rr4 at dragonfly.wolfram.com> Donald Darling  
<ddarling at math.uci.edu> writes:
> Can someone tell me why, after I load the package ReIm and declare the 
> variables z and u real, it takes over 15 minutes to evaluate 
> Re[(1- I u z)/(1-2 I u z - z^2)] ? 
> 
> Thanks ...  Don Darling.  
> 


  Cannot answer this one directly. But I note that you can get much faster  
results with:

In[3]:= ComplexExpand[Re[(1- I u z)/(1-2 I u z - z^2)], z] // InputForm
Out[3]//InputForm= 
   ((1 + u*Im[z])*(1 + 2*u*Im[z] + Im[z]^2 - Re[z]^2))/
    Abs[1 - 2*I*u*z - z^2]^2

or, if you do not want to see Abs/Arg,

In[4]:= ComplexExpand[Re[(1- I u z)/(1-2 I u z - z^2)], z,  
TargetFunctions->{Re, Im}] // InputForm
Out[4]//InputForm= 
    ((-2*u*Re[z] - 2*Im[z]*Re[z])^2 + (1 + 2*u*Im[z] + Im[z]^2 -  
Re[z]^2)^2) \
    + ((1 + u*Im[z])*(1 + 2*u*Im[z] + Im[z]^2 - Re[z]^2))/
    ((-2*u*Re[z] - 2*Im[z]*Re[z])^2 + (1 + 2*u*Im[z] + Im[z]^2 -  
Re[z]^2)^2)


Daniel Lichtblau
Wolfram Research, Inc
danl at wolfram.com

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Mathematica[2.2.3] && Win[95] := Poor[Performance]
  • Next by Date: Re: Slow ReIm
  • Previous by thread: Re:FAQ for comp.soft-sys.math.math
  • Next by thread: Re: Slow ReIm