Ticket #12737: sage-trac_12737-remove_radcan.patch

File sage-trac_12737-remove_radcan.patch, 5.4 KB (added by mjo, 7 years ago)

Same patch with the functional.py doctest factored out

  • sage/calculus/wester.py

    # HG changeset patch
    # User Michael Orlitzky <michael@orlitzky.com>
    # Date 1334514809 14400
    # Node ID e98b5e431e85ad967120320d4363561d0f7dadfd
    # Parent  7d8ac0ee679de0e5eeba4966fe280f5f65295472
    Trac #12737: Remove Expression.simplify_radical() from Expression.simplify_full().
    
     * Remove the call to simplify_radical() in simplify_full().
    
     * Move a doctest from simplify_full() to simplify_radical().
    
     * Fix a doctest in sage/misc/functional.py by replacing
       simplify_full() with simplify() and appropriate assumptions. The
       test worked previously, with its assumptions missing, thanks to
       simplify_radical and a little bit of luck.
    
     * Update a doctest in sage/modules/vector_symbolic_dense.py. The
       result is now slightly worse, but doesn't make invalid assumptions
       about the domain either.
    
     * Update two doctests in sage/calculus/wester.py and
       sage/symbolic/integration/integral.py to call simplify_radical()
       instead of simplify_full().
    
     * Change two doctests for floor/ceil to use sin() and cos() instead
       log(). This still tests that those functions convert to SR and
       simplify, but does not make any assumptions about the domain of
       the answer.
    
     * Adjust a doctest in sage/interfaces/maxima_lib.py to use
       simplify_radical() instead of simplify_full().
    
    diff --git a/sage/calculus/wester.py b/sage/calculus/wester.py
    a b  
    120120    (e^x - 1)/(e^(1/2*x) + 1)
    121121    sage: g
    122122    e^(1/2*x) - 1
    123     sage: f.simplify_full(),g
    124     (e^(1/2*x) - 1, e^(1/2*x) - 1)
     123    sage: f.simplify_radical()
     124    e^(1/2*x) - 1
     125    sage: g
     126    e^(1/2*x) - 1
    125127    sage: f(x=10.0).n(53), g(x=10.0).n(53)
    126128    (147.413159102577, 147.413159102577)
    127129    sage: bool(f == g)
  • sage/functions/other.py

    diff --git a/sage/functions/other.py b/sage/functions/other.py
    a b  
    240240
    241241        ::
    242242
    243             sage: ceil(log(8)/log(2))
    244             3
     243            sage: ceil(sin(8)/sin(2))
     244            2
    245245
    246246        ::
    247247
     
    412412
    413413        ::
    414414
    415             sage: floor(log(8)/log(2))
    416             3
     415            sage: floor(cos(8)/cos(2))
     416            0
    417417
    418418        ::
    419419
  • sage/interfaces/maxima_lib.py

    diff --git a/sage/interfaces/maxima_lib.py b/sage/interfaces/maxima_lib.py
    a b  
    713713
    714714        ::
    715715
    716             sage: integrate(sqrt(x + sqrt(x)), x).simplify_full()
     716            sage: integrate(sqrt(x + sqrt(x)), x).simplify_radical()
    717717            1/12*sqrt(sqrt(x) + 1)*((8*x - 3)*x^(1/4) + 2*x^(3/4)) - 1/8*log(sqrt(sqrt(x) + 1) - x^(1/4)) + 1/8*log(sqrt(sqrt(x) + 1) + x^(1/4))
    718718
    719719        And trac #11594::
     
    946946            sage: from sage.interfaces.maxima_lib import maxima_lib
    947947            sage: sol = maxima_lib(sin(x) == 0).to_poly_solve(x)
    948948            sage: sol.sage()
    949             [[x == pi + 2*pi*z60], [x == 2*pi*z62]]
     949            [[x == pi + 2*pi*z36], [x == 2*pi*z38]]
    950950        """
    951951        if options.find("use_grobner=true") != -1:
    952952            cmd=EclObject([[max_to_poly_solve], self.ecl(), sr_to_max(vars),
  • sage/modules/vector_symbolic_dense.py

    diff --git a/sage/modules/vector_symbolic_dense.py b/sage/modules/vector_symbolic_dense.py
    a b  
    1717    sage: type(u)
    1818    <class 'sage.modules.vector_symbolic_dense.Vector_symbolic_dense'>
    1919    sage: u.simplify_full()
    20     (1, log(6) + 2*log(y))
     20    (1, log(6*y^2))
    2121
    2222TESTS:
    2323
  • sage/symbolic/expression.pyx

    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    68896889        ALIAS: simplify_full and full_simplify are the same.
    68906890       
    68916891        EXAMPLES::
    6892        
    6893             sage: a = log(8)/log(2)
    6894             sage: a.simplify_full()
    6895             3
    6896        
    6897         ::
    6898        
     6892
    68996893            sage: f = sin(x)^2 + cos(x)^2
    69006894            sage: f.simplify_full()
    69016895            1
     
    69136907            sage: f = binomial(n,k)*factorial(k)*factorial(n-k)
    69146908            sage: f.simplify_full()
    69156909            factorial(n)
     6910
     6911        TESTS:
     6912
     6913        There are two square roots of `$(x + 1)^2$`, so this should
     6914        not be simplified to `$x + 1$`::
     6915
     6916            sage: f = sqrt((x + 1)^2)
     6917            sage: f.simplify_full()
     6918            sqrt(x^2 + 2*x + 1)
     6919
    69166920        """
    69176921        x = self
    69186922        x = x.simplify_factorial()
    69196923        x = x.simplify_trig()
    69206924        x = x.simplify_rational()
    6921         x = x.simplify_radical()
    69226925        x = x.simplify_log('one')
    69236926        x = x.simplify_rational()
    69246927        return x
     
    71737176            :meth:`exp_simplify`, :meth:`simplify_exp` are all the same.
    71747177       
    71757178        EXAMPLES::
    7176        
     7179
     7180            sage: a = log(8)/log(2)
     7181            sage: a.simplify_radical()
     7182            3
     7183
     7184        ::
     7185
    71777186            sage: var('x,y,a')
    71787187            (x, y, a)
    71797188       
  • sage/symbolic/integration/integral.py

    diff --git a/sage/symbolic/integration/integral.py b/sage/symbolic/integration/integral.py
    a b  
    577577    of the gamma function; however, we get something equivalent::
    578578
    579579        sage: actual_result = integral(e^(-1/x^2), x, 0, 1)
    580         sage: actual_result.full_simplify()
     580        sage: actual_result.simplify_radical()
    581581        ((e*erf(1) - e)*sqrt(pi) + 1)*e^(-1)
    582582        sage: ideal_result = 1/2*gamma(-1/2, 1)
    583583        sage: error = actual_result - ideal_result