Ticket #9538: trac_9538-maxima_kill.take2.patch

File trac_9538-maxima_kill.take2.patch, 2.0 KB (added by burcin, 12 years ago)

apply only this patch -- forget about the package :)

  • sage/calculus/calculus.py

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1285948373 -7200
    # Node ID ab64f6839bd9f0b57c418594fa03efa2a863caef
    # Parent  c1af00e863a500ab65e3950b708c2e5b8eba3ca1
    trac 9538: test if variables from symbolic summation tests still interfere with calculations in maxima
    
    diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
    a b  
    361361        definite_integral
    362362import sage.symbolic.pynac
    363363
    364 maxima = Maxima(init_code = ['display2d:false', 'domain: complex', 'keepfloat: true', 'load(to_poly_solver)', 'load(simplify_sum)'],
     364"""
     365Check if maxima has redundant variables defined after initialization #9538::
     366
     367    sage: maxima = Maxima(init_code = ['load(simplify_sum)'])
     368    sage: maxima('f1')
     369    binomial(n,k)
     370    sage: sage.calculus.calculus.maxima('f1')
     371    f1
     372"""
     373maxima = Maxima(init_code = ['display2d:false', 'domain: complex',
     374    'keepfloat: true', 'load(to_poly_solver)', 'load(simplify_sum)',
     375    'kill (g1, g2, g3, g4, g5, g6, g7, f1, f2, f3, f4, f5, f6, f7, f8, f9,\
     376            f10, h1, h2, h3, h4, h5, h6, h6b, h7, h8, h9, h10, h11, h12, h13,\
     377            d1, d2)'],
    365378                script_subdirectory=None)
    366379
    367380########################################################
  • sage/symbolic/expression.pyx

    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    68746874            Traceback (most recent call last):
    68756875            ...
    68766876            TypeError: unable to convert sqrt(3) to a rational
     6877
     6878        Check if #9538 is fixed::
     6879
     6880            sage: var('f6,f5,f4,x')
     6881            (f6, f5, f4, x)
     6882            sage: e=15*f6*x^2 + 5*f5*x + f4
     6883            sage: res = e.roots(x); res
     6884            [(-1/30*(sqrt(-12*f4*f6 + 5*f5^2)*sqrt(5) + 5*f5)/f6, 1), (1/30*(sqrt(-12*f4*f6 + 5*f5^2)*sqrt(5) - 5*f5)/f6, 1)]
     6885            sage: e.subs(x=res[0][0]).is_zero()
     6886            True
    68776887        """
    68786888        if x is None:
    68796889            x = self.default_variable()