Ticket #6256 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[with patch and package, positive review] bug in symbolic arithmetic with exp

Reported by: burcin Owned by: burcin
Priority: blocker Milestone: sage-4.0.2
Component: symbolics Keywords:
Cc: jason Work issues:
Report Upstream: Reviewers: Nick Alexander
Authors: Burcin Erocal Merged in: 4.0.2.alpha0
Dependencies: Stopgaps:

Description

sage: var('kappa')
kappa
sage: x = sqrt(kappa)
sage: F = exp(x)
sage: F
e^sqrt(kappa)
sage: F/F
e^(2*sqrt(kappa))
sage: 1/F
e^(-sqrt(kappa))
sage: (1/F) * F
e^(2*sqrt(kappa))

Attachments

trac_6256-pynac_mul_compare_tests.patch Download (669 bytes) - added by burcin 4 years ago.
doctests

Change History

comment:1 Changed 4 years ago by burcin

  • Status changed from new to assigned

Here is the fix for pynac:

diff --git a/ginac/mul.cpp b/ginac/mul.cpp
--- a/ginac/mul.cpp
+++ b/ginac/mul.cpp
@@ -1167,7 +1167,7 @@
        if (cmpval != 0) {
                return cmpval;
        }
-       if (seq.size() == 1 && overall_coeff.is_equal(_ex_1))
+       if (seq.size() == 1 && overall_coeff.is_equal(_ex1))
                return 0;
        return 1;
 }

I'll post an updated spkg later together with a fix for #6244.

Changed 4 years ago by burcin

doctests

comment:2 Changed 4 years ago by burcin

  • Cc jason added
  • Summary changed from bug in symbolic arithmetic with exp to [with patch and package, needs review] bug in symbolic arithmetic with exp

New pynac package fixes this:

 http://sage.math.washington.edu/home/burcin/pynac/pynac-0.1.8.p0.spkg

It also contains fixes for #6244 and #6211, so doctests should be run with patches from those tickets applied.

Jason, can you review this?

comment:3 Changed 4 years ago by ncalexan

  • Status changed from assigned to closed
  • Authors set to Burcin Erocal
  • Summary changed from [with patch and package, needs review] bug in symbolic arithmetic with exp to [with patch and package, positive review] bug in symbolic arithmetic with exp
  • Reviewers set to Nick Alexander
  • Resolution set to fixed
  • Merged in set to 4.0.2.alpha0

Fine by me, works with new spkg.

Note: See TracTickets for help on using tickets.