MathGroup Archive 2009

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

Search the Archive

Re: Answer for Simplify[Cos[x]^4-Sin[x]^4]?

On 11/3/09 at 2:51 AM, lawrenceteo at (Lawrence Teo) wrote:

>Thanks for the insight. So Simplify[] in Mathematica is right. But
>why I observe small delta if I subtract the two expressions with //
>N? Is it because of machine precision related limitation?

>a = Cos[x]^2 - Sin[x]^2
>b = Cos[x]^4 - Sin[x]^4
>Table[a - b, {x, -10, 10}] // N

>Return small delta...

The issue is the limitations of machine precision numbers. This
is easily demonstrated by

In[36]:= a = Cos[x]^2 - Sin[x]^2;
b = Cos[x]^4 - Sin[x]^4;
Union[Table[a - b, {x, -10, 10}] // Simplify]

Out[38]= {0}


In[39]:= Union[Table[a - b, {x, -10, 10}] // N // Chop]

Out[39]= {0}

or most directly by

In[41]:= a - b // Simplify

Out[41]= 0

  • Prev by Date: Re: Re: Fit function vs Hand Calculation
  • Next by Date: Re: Finding Clusters
  • Previous by thread: Re: Answer for Simplify[Cos[x]^4-Sin[x]^4]?
  • Next by thread: SetDelayed and Evaluate