#11934: Symbolic simplification error
------------------------------------+---------------------------------------
       Reporter:  mjo               |         Owner:  burcin    
           Type:  defect            |        Status:  needs_info
       Priority:  major             |     Milestone:  sage-5.11 
      Component:  symbolics         |    Resolution:            
       Keywords:                    |   Work issues:            
Report Upstream:  N/A               |     Reviewers:            
        Authors:  Michael Orlitzky  |     Merged in:            
   Dependencies:  #12322            |      Stopgaps:            
------------------------------------+---------------------------------------

Comment (by mjo):

 Replying to [comment:6 kcrisman]:
 > Needs work/info, but not because of your patch or #12737, but rather
 because this doesn't really treat the underlying issue.  This could just
 be some floating point thing that is inherently impossible to avoid once
 one allows complex numbers (and since your original example is complex
 sometimes, the answers are going to be complex, unfortunately).

 There aren't any floating point issues if you don't call `n()` on
 anything. The issue is still there with `simplify_radical()`, but that's
 because `simplify_radical()` is broken by design: it chooses a branch
 arbitrarily for the square root. This is what `radcan()` in Maxima is
 documented to do, but if you re-brand it as a simplification, it's a bug.

 Plain `simplify()` works:

 {{{
 sage: f = sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
 sage: f.simplify()
 sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
 }}}

 As does `simplify_trig()`:

 {{{
 sage: f.simplify_trig()
 sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
 }}}

 And `simplify_rational()`:

 {{{
 sage: f.simplify_rational()
 sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
 }}}

 And `simplify_log()`:

 {{{
 sage: f.simplify_log()
 sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
 }}}

 It's only `simplify_radical()` that messes everything up (note I haven't
 called `n()` anywhere, so there are no numerical issues):

 {{{
 sage: f.simplify_radical()
 2*I*sqrt((4*sqrt(2) - 7)*x - 6*sqrt(2) + 10)*sqrt(2)*x^(3/2)
 }}}

 I don't want a random branch of the square root when I ask for a
 simplification. I want a simplification, but only if possible! Without
 more information, you can't simplify that expression. The rest of the
 simplify functions don't do anything, but that's the correct thing to do
 here.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11934#comment:7>
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/groups/opt_out.


Reply via email to