MathGroup Archive 2009

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104639] Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Thu, 5 Nov 2009 03:52:27 -0500 (EST)
  • References: <hce437$r4t$1@smc.vnet.net> <hcgmni$cpe$1@smc.vnet.net> <hcone9$100$1@smc.vnet.net>

On 2009.11.03. 8:51, Lawrence Teo wrote:
> Hi all,
>
> 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
>

It's because of rounding errors.

http://mathworld.wolfram.com/RoundoffError.html

Try this instead of Table:

Plot[Cos[x]^2 - Sin[x]^2 - (Cos[x]^4 - Sin[x]^4), {x, 0, 2 Pi}]



  • Prev by Date: Contour plot labels with higher precision
  • Next by Date: Aligning framed graphics in rows
  • Previous by thread: Re: Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?
  • Next by thread: Characteristic Function of Pareto distribution