#17065: use Maxima's trigrat() in symbolic simplify
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  symbolics          |   Resolution:
       Keywords:  maxima,            |    Merged in:
  simplification, trigonometric      |    Reviewers:
        Authors:  Ralf Stephan       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  3db6f899c380523dc6d6e940650eede5984a37fa
  u/rws/use_maxima_s_trigrat___in_symbolic_simplify|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by rws):

 Replying to [comment:5 kcrisman]:
 > This can even lead to disaster, I think:
 > {{{
 > sage: F = (4*cos(9*pi/180)^2 - 3)*(4*cos(27*pi/180)^2 - 3)
 > sage: F.maxima_methods().trigrat()
 > sqrt(5) + 2*cos(7/10*pi) - 2*cos(1/10*pi) - 2*I*sin(3/5*pi) +
 > 2*I*sin(2/5*pi) + 1
 > }}}
 > I really am not interested in seeing `I` turn up in such a
 simplification, regardless of the "correct" answer.
 While this one could be resolved by adding a `trigreduce` to the queue:
 {{{
 sage: F = (4*cos(9*pi/180)^2 - 3)*(4*cos(27*pi/180)^2 - 3)
 sage: F.maxima_methods().trigrat()
 sqrt(5) + 2*cos(7/10*pi) - 2*cos(1/10*pi) - 2*I*sin(3/5*pi) +
 2*I*sin(2/5*pi) + 1
 sage: _.maxima_methods().trigreduce()
 sqrt(5) - 2*cos(3/10*pi) - 2*cos(1/10*pi) + 1
 }}}
 I cannot see how to fix the doctest failure:
 {{{
 File "src/doc/de/thematische_anleitungen/sage_gymnasium.rst", line 394, in
 doc.de.thematische_anleitungen.sage_gymnasium
 Failed example:
     (sin(x + y)/(log(x) + log(y))).simplify_full()
 Expected:
     (cos(y)*sin(x) + cos(x)*sin(y))/log(x*y)
 Got:
     ((-I*arctan2(0, x) - I*arctan2(0, y))*sin(x + y) +
 log(abs(x)*abs(y))*sin(x + y))/(arctan2(0, x)^2 + 2*arctan2(0,
 x)*arctan2(0, y) + arctan2(0, y)^2 + log(abs(x))^2 +
 2*log(abs(x))*log(abs(y)) + log(abs(y))^2)
 }}}
 the minimal case being
 {{{
 sage: log(x).maxima_methods().trigrat()
 I*arctan2(0, x) + log(abs(x))
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17065#comment:8>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to