Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18896 closed defect (fixed)

symbolic root comparisons call Maxima unnecessarily

Reported by: rws Owned by:
Priority: major Milestone: sage-6.8
Component: symbolics Keywords:
Cc: vbraun Merged in:
Authors: Ralf Stephan Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: 6c89be9 (Commits) Commit:
Dependencies: Stopgaps:

Description (last modified by rws)

Reported in!topic/sage-support/b6OinTC9mdk

sage: m=540579833922455191419978421211010409605356811833049025*sqrt(1/2)
sage: m1=382247666339265723780973363167714496025733124557617743
sage: bool(m==m1)

Like #18883 is another case of falling through in Expression.__nonzero__ to calling Maxima which fails, in this case because of its hardcoded 53 bits precision. The reason why Maxima is called at all is that test_relation() coerces lhs()-rhs() into CIF as a catch-all. The result passes is_zero() so NotImplemented is returned.

Change History (8)

comment:1 Changed 5 years ago by rws

  • Description modified (diff)

comment:2 Changed 5 years ago by rws

  • Branch set to u/rws/symbolic_root_comparisons_call_maxima_unnecessarily

comment:3 Changed 5 years ago by rws

  • Commit set to 28341703ea47447dc242ff504306816c4f7645d2

This draft triggers three doctests:

sage -t --long src/sage/calculus/  # 2 doctests failed
sage -t --long src/sage/calculus/  # 1 doctest failed

New commits:

283417018896: handle relations of algebraic expressions

comment:4 Changed 5 years ago by git

  • Commit changed from 28341703ea47447dc242ff504306816c4f7645d2 to 6c89be9557a709b4c0f669c679a6db3154ecdf64

Branch pushed to git repo; I updated commit sha1. New commits:

6c89be918896: add logic for given domain; fix failing doctests

comment:5 follow-up: Changed 5 years ago by rws

  • Authors set to Ralf Stephan
  • Status changed from new to needs_review

Sage now also passes one more test from Wester's paper.

comment:6 Changed 5 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

comment:7 Changed 5 years ago by vbraun

  • Branch changed from u/rws/symbolic_root_comparisons_call_maxima_unnecessarily to 6c89be9557a709b4c0f669c679a6db3154ecdf64
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:8 in reply to: ↑ 5 Changed 5 years ago by kcrisman

  • Commit 6c89be9557a709b4c0f669c679a6db3154ecdf64 deleted

Sage now also passes one more test from Wester's paper.

Nice work!

Note: See TracTickets for help on using tickets.