Ticket #11934: sage-trac_11934.patch

File sage-trac_11934.patch, 964 bytes (added by mjo, 9 years ago)

Doctest for a subexpression of the one in the ticket

  • sage/symbolic/expression.pyx

    # HG changeset patch
    # User Michael Orlitzky <michael@orlitzky.com>
    # Date 1376701384 14400
    # Node ID 5c647669df26cac55fbbf4219a8bc2d36fedf302
    # Parent  5683d7fca739649ee135a5b897383633444765a5
    Trac #11934: Add a doctest to confirm that full_simplify() doesn't affect the imaginary part of an expression.
    
    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    78087808            sage: f.simplify_full()
    78097809            sqrt(x^2 + 2*x + 1)
    78107810
     7811        The imaginary part of an expression should not change under
     7812        simplification; :trac:`11934`::
     7813
     7814            sage: f = sqrt(-8*(4*sqrt(2) - 7)*x^4 + 16*(3*sqrt(2) - 5)*x^3)
     7815            sage: original = f.imag_part()
     7816            sage: simplified = f.full_simplify().imag_part()
     7817            sage: original - simplified
     7818            0
     7819
    78117820        """
    78127821        x = self
    78137822        x = x.simplify_factorial()