Opened 6 years ago

Closed 5 years ago

#15571 closed defect (fixed)

Doctest: Incorrect zero test of complex symbolic expressions

Reported by: mmezzarobba Owned by:
Priority: major Milestone: sage-6.5
Component: symbolics Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: 9974eef (Commits) Commit: 9974eef85cab383846b82d39a39c7b5d50da1608
Dependencies: Stopgaps:

Description (last modified by rws)

This is fixed but needs a doctest:

Yet another example where symbolic expressions are abusively considered equivalent, even though simplify() has become a bit more careful.

sage: var('a,x')
(a, x)
sage: assume(a, 'complex')
sage: assume(x, 'complex')
sage: expr = a^(4*x) - (a^4)^x
sage: expr.is_zero()
True
sage: expr(a=I, x=1/2)
-2

Change History (9)

comment:1 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:2 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:3 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:4 Changed 5 years ago by rws

  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

Appears to having been fixed and also already included in Sage.

comment:5 Changed 5 years ago by rws

  • Description modified (diff)
  • Milestone changed from sage-duplicate/invalid/wontfix to sage-6.5
  • Status changed from needs_review to needs_work
  • Summary changed from Incorrect zero test of complex symbolic expressions to Doctest: Incorrect zero test of complex symbolic expressions

comment:6 Changed 5 years ago by rws

  • Branch set to u/rws/doctest__incorrect_zero_test_of_complex_symbolic_expressions

comment:7 Changed 5 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 9974eef85cab383846b82d39a39c7b5d50da1608
  • Status changed from needs_work to needs_review

New commits:

9974eef15571: add doctest

comment:8 Changed 5 years ago by kcrisman

  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to positive_review

Indeed, one doesn't have to do any assumption at all to get the 'false' now.

sage: sage: var('a,x')
(a, x)
sage: (a, x)
(a, x)
sage: sage: expr = a^(4*x) - (a^4)^x
sage: sage: expr.is_zero()
False

If you want to remove the second

+            sage: assume(a, 'complex')
+            sage: assume(x, 'complex')

and then the forget() which I think is all superfluous, that would be great, but it's fine this way too.

comment:9 Changed 5 years ago by vbraun

  • Branch changed from u/rws/doctest__incorrect_zero_test_of_complex_symbolic_expressions to 9974eef85cab383846b82d39a39c7b5d50da1608
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.