sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.3k stars 449 forks source link

Wrong simplification in symbolic trigonometry involving fractions #20752

Closed edd8e884-f507-429a-b577-5d554626c0fe closed 8 years ago

edd8e884-f507-429a-b577-5d554626c0fe commented 8 years ago

As reported in this ask question, Sage makes wrong simplifications in symbolic trigonometry involving fractions:

sage: cos(pi+pi*1/42)
cos(1/42*pi)

While it should be -cos(1/42*pi).

CC: @rwst

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/20752

rwst commented 8 years ago
comment:1

Same with sin(pi+pi/42).

edd8e884-f507-429a-b577-5d554626c0fe commented 8 years ago
comment:2

I do not have intermediate versions of Sage with me, but i confirm that it is a regression since on Sage 5.12, we have:

sage: cos(pi+pi*1/42)
cos(43/42*pi)
sage: sin(pi+pi/42)
sin(43/42*pi)
rwst commented 8 years ago
comment:3

No, the changes were just a few months ago, will get to it tomorrow.

edd8e884-f507-429a-b577-5d554626c0fe commented 8 years ago
comment:4

More precisely, on a 7.2.beta4 version of Sage which i can reach by ssh, it works well:

sage: cos(pi+pi*1/42)
cos(43/42*pi)
sage: sin(pi+pi*1/42)
sin(43/42*pi)

So the regression is very recent, could it be due to the last update of pynac/ginac ?

edd8e884-f507-429a-b577-5d554626c0fe commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,4 @@
-As reported in [this ask question](http://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/?answer=33624#post-id-33624), Sage makes wrong simplifications in symbolic trigonometry:
+As reported in [this ask question](http://ask.sagemath.org/question/33623/bug-in-cos-function-in-version-72/?answer=33624#post-id-33624), Sage makes wrong simplifications in symbolic trigonometry involving fractions:

sage: cos(pi+pi*1/42)

kcrisman commented 8 years ago
comment:7

So the regression is very recent, could it be due to the last update of pynac/ginac ?

Almost certainly so. See e.g. this bug, though I assume it is a different particular one.

rwst commented 8 years ago
comment:8

This is fixed and doctested in #20742.

embray commented 8 years ago
comment:10

Determined to be invalid/duplicate/wontfix (closing as "wontfix" as a catch-all resolution).