MathGroup Archive 2003

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

Search the Archive

ComplexityFunction failure in Simplify

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43556] ComplexityFunction failure in Simplify
  • From: Artūras Acus <acus at itpa.lt>
  • Date: Sat, 20 Sep 2003 06:39:25 -0400 (EDT)
  • Organization: Institute of Theoretical Physics and Astronomy
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Group, 
Why complexity function in Simplify and FullSimplify 
dont work properly in this case. Thanks in advice for any ideas to
improve it in order to get the first rezult.


In[1]:=
test=-j*(j+1)+2 Cos[2* F]* j *(j+1)+(4/3)*Sin[F]^2 *j*(j+1)-
      Cos[2*F]^2* j *(j+1)-4*Sin[F]^4* (1/(4*3*5))*(12*j
*(j+1)-4)-4*Cos[2*F]*
        Sin[F]^2*(1/3)*j *(j+1)-(1/3)*Sin[2*F]^2;


In[2]:=
rez1 = Simplify[test] /. Cos[2 F] -> 1 - 2 Sin[F]^2 // 
          Expand // Factor // InputForm
	  
Out[2]//InputForm=
(-4*Sin[F]^2*(5 - 6*Sin[F]^2 + 8*j*Sin[F]^2 + 8*j^2*Sin[F]^2))/15

In[3]:=
LeafCount[%]

Out[3]=
32

In[4]:=
rez2=FullSimplify[test,
      ComplexityFunction -> (Count[ExpToTrig[#],Cos[_],Infinity])&]//
    InputForm
    
Out[4]//InputForm=
(4*(-2*(1 + 2*j*(1 + j)) + (-3 + 4*j*(1 + j))*Cos[2*F])*Sin[F]^2)/15

In[5]:=
LeafCount[%]
Out[5]=
32


Sincerely, Arturas Acus


  • Prev by Date: Re: Annotating Mathematica-generated postscript graphics
  • Next by Date: Re: Share processor time between calculations
  • Previous by thread: question of Simplify
  • Next by thread: Export outrage