Opened 12 months ago

Closed 8 months ago

#30786 closed defect (fixed)

Multiplying and dividing by 3 hangs

Reported by: gh-GMS103 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

Description

Tested with https://sagecell.sagemath.org

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 12 months ago by gh-DaveWitteMorris

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 12 months ago by gh-bmlivin

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 12 months ago by gh-GMS103

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

comment:4 Changed 10 months ago by gh-DaveWitteMorris

  • Component changed from basic arithmetic to symbolics
  • Dependencies set to #30446
  • Milestone changed from sage-9.1.1 to sage-9.4
  • Priority changed from major to minor

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 10 months ago by gh-DaveWitteMorris

  • Branch set to public/30786

comment:6 Changed 10 months ago by gh-DaveWitteMorris

  • Authors set to Dave Morris
  • Commit set to 4a5d0536a91fd3ef538c3430e3b668c75272225d
  • Milestone changed from sage-9.4 to sage-9.3
  • Status changed from new to needs_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 10 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:8 Changed 10 months ago by gh-DaveWitteMorris

Thanks!

comment:9 Changed 9 months ago by dimpase

  • Status changed from positive_review to needs_work

rebase over new #30446

comment:10 Changed 9 months ago by git

  • Commit changed from 4a5d0536a91fd3ef538c3430e3b668c75272225d to 6ee3113a288a36519ed1a4b0adbd19250404874b

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 9 months ago by dimpase

  • Reviewers changed from Travis Scrimshaw to Travis Scrimshaw, Dima Pasechnik
  • Status changed from needs_work to positive_review

OK, done

comment:12 Changed 8 months ago by vbraun

  • Branch changed from public/30786 to 6ee3113a288a36519ed1a4b0adbd19250404874b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.