2012-04-22 14:39, Duc Trung Ha skrev:
Am I missing something or is this behavior rather peculiar:

sage: bool(sin(x) == sin(x+2*pi))
True

...however:

plot(sin(x) - sin(x+2*pi))

gives out the result:
> [plot showing inaccuracies of floats]

I typed this instead, and got a nice line at 0:

plot(simplify(sin((2*pi) + x) - sin(x)),-100,100)

It seems that your plot evaluates both sin-calls numerically, and as we use floating point numbers of a certain precision, they will differ around the 15-th digit, which is what you see.

Perhaps the simplify-call uses the identity you mention to replace the expression by 0, and then plots 0.

Moreover, example below isn't even recognized as an identity:

sage: bool ( sin((2*pi^2 + x)/pi) == sin(x/pi) )
False


You could use:
bool (sin(((2*pi^2 + x)/pi).expand()).full_simplify() == sin(x/pi))

Is this a bug or is it covered somewhere else?


I might consider it a bug that not every identity is used by default, but I would add that I expect it to be an unsolvable problem:

1) We want it fast.
2) We want it to use all simplification methods.
3) We _need_ a yes/no answer.

I will let the experts tell the story in more detail.

Regards

Johan

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to