Opened 2 years ago

Closed 21 months ago

#30786 closed defect (fixed)

Multiplying and dividing by 3 hangs

Reported by: GMS Owned by:
Priority: minor Milestone: sage-9.3
Component: symbolics Keywords:
Cc: Merged in:
Authors: Dave Morris Reviewers: Travis Scrimshaw, Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 6ee3113 (Commits, GitHub, GitLab) Commit: 6ee3113a288a36519ed1a4b0adbd19250404874b
Dependencies: #30446 Stopgaps:

Status badges


Tested with

sage: version()
'SageMath version 9.1, Release Date: 2020-05-20'

All of these work as expected:

sage: exp(-ln(-x))
sage: exp(-3*ln(-x)/3)
sage: exp(-ln(-9*x))

However this hangs:

sage: exp(-3*ln(-9*x)/3)

In case you are curious, this is what I was doing (the expressions were a bit more complex, of course):

sage: a=var('a')
sage: y=exp(-3*x)
sage: x0=ln(-9*a)/3
sage: y(x=x0)

Change History (12)

comment:1 Changed 2 years ago by Dave Morris

I confirm that there is a problem. CoCalc ran out of memory. My laptop (9.2rc2 on MacOS 10.15.7) completed eventually (I think it took about half an hour). The output is a 4GB string of nonsense that seems to be almost entirely digits, but starts with -1/34723950083 and ends with 91987451449/x.

These symptoms are somewhat similar to #30446.

comment:2 Changed 2 years ago by Ben Livingston

DaveWitteMorris is correct. I checked and this is the same issue as #30446. If you look on that ticket, I submitted a pull request with pynac that will fix the issue.

comment:3 Changed 2 years ago by GMS

Thanks for the feedback, I was really surprised by this bug. Glad to know it will be fixed.

comment:4 Changed 23 months ago by Dave Morris

Component: basic arithmeticsymbolics
Dependencies: #30446
Milestone: sage-9.1.1sage-9.4
Priority: majorminor

As pointed out in comment:2, this will be fixed by the patch to pynac in #30446. When that ticket is closed, we can add this as another doctest.

comment:5 Changed 23 months ago by Dave Morris

Branch: public/30786

comment:6 Changed 23 months ago by Dave Morris

Authors: Dave Morris
Commit: 4a5d0536a91fd3ef538c3430e3b668c75272225d
Milestone: sage-9.4sage-9.3
Status: newneeds_review

The PR adds doctests for the bugs on this ticket, #28620, and #30304. All were fixed by the patch to pynac at #30446 (which has positive review). These doctests are in the _pow_ method, and I moved the doctest of #30446 to the same place. (It was in the _latex_ method, which does not seem like such a good place.)

New commits:

dc073dffixes for trac #30446
4a5d053doctests for trac 28620, 30304, 30786

comment:7 Changed 23 months ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review


comment:8 Changed 23 months ago by Dave Morris


comment:9 Changed 22 months ago by Dima Pasechnik

Status: positive_reviewneeds_work

rebase over new #30446

comment:10 Changed 22 months ago by git

Commit: 4a5d0536a91fd3ef538c3430e3b668c75272225d6ee3113a288a36519ed1a4b0adbd19250404874b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

9d747fcsage --package update-latest: Distinguish pypi package name and spkg name
f74f66csage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages
182b3d2sage -package fix-checksum: Handle package classes, ignore non-normal packages
9a57cf6pynac update
563940edoctest from #30446
51def3csane version name
4834dc8remove upstreamed patch
214712dtarball update
6ee3113doctests for trac 28620, 30304, 30786

comment:11 Changed 22 months ago by Dima Pasechnik

Reviewers: Travis ScrimshawTravis Scrimshaw, Dima Pasechnik
Status: needs_workpositive_review

OK, done

comment:12 Changed 21 months ago by Volker Braun

Branch: public/307866ee3113a288a36519ed1a4b0adbd19250404874b
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.