#19738: inconsistency in what simplify() does on trigonometrics expression
-------------------------------------------------+-------------------------
       Reporter:  thome                          |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  minor                          |    Milestone:  sage-7.0
      Component:  symbolics                      |   Resolution:
       Keywords:                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Reported upstream. Developers  |  Work issues:
  acknowledge bug.                               |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------
Changes (by rws):

 * upstream:  N/A => Reported upstream. Developers acknowledge bug.


Old description:

> I stumbled on the following oddity during an exercise class (sage-6.8,
> x86_64-linux, debian 8.2).
> {{{
> sage: simplify(cos(pi/12))
> 1/12*sqrt(6)*(sqrt(3) + 3)
> sage: simplify(sin(pi/12))
> -1/12*sqrt(6)*(sqrt(3) - 3)
> sage: simplify(exp(i*pi/12))
> e^(1/12*I*pi)
> }}}
> Is there any rationale for this ? It looks like an inconsistency.

New description:

 I stumbled on the following oddity during an exercise class (sage-6.8,
 x86_64-linux, debian 8.2).
 {{{
 sage: simplify(cos(pi/12))
 1/12*sqrt(6)*(sqrt(3) + 3)
 sage: simplify(sin(pi/12))
 -1/12*sqrt(6)*(sqrt(3) - 3)
 sage: simplify(exp(i*pi/12))
 e^(1/12*I*pi)
 }}}
 Is there any rationale for this ? It looks like an inconsistency.

 See https://github.com/pynac/pynac/issues/113

--

Comment:

 Note expansion is done without the need for simplify.

 Certainly the enhancement is within reach. There is a minor catch:
 although shortly before we have extended the values `m` for which
 `sin/cos/tan(n/m*pi)` is expanded in roots, simply doing `I*sin+cos` can
 result in mixed expressions because implementations differed for `sin` vs
 `cos`, e.g.
 {{{
 sage: sin(pi/15)
 sin(1/15*pi)
 sage: cos(pi/15)
 1/8*sqrt(5) + 1/4*sqrt(3/2*sqrt(5) + 15/2) - 1/8
 sage: I*sin(pi/15)+cos(pi/15)
 1/8*sqrt(5) + 1/4*sqrt(3/2*sqrt(5) + 15/2) + I*sin(1/15*pi) - 1/8
 }}}
 The reason for the difference was the complexity of results---we stopped
 when the roots were nested more than twice.

--
Ticket URL: <http://trac.sagemath.org/ticket/19738#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to