Opened 2 years ago

Closed 21 months ago

# Multiplying and dividing by 3 hangs

Reported by: Owned by: GMS minor sage-9.3 symbolics Dave Morris Travis Scrimshaw, Dima Pasechnik N/A 6ee3113 6ee3113a288a36519ed1a4b0adbd19250404874b #30446

### 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)
```

### 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 arithmetic → symbolics → #30446 sage-9.1.1 → sage-9.4 major → 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 23 months ago by Dave Morris

Branch: → public/30786

### comment:6 Changed 23 months ago by Dave Morris

Authors: → Dave Morris → 4a5d0536a91fd3ef538c3430e3b668c75272225d sage-9.4 → sage-9.3 new → 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:

 ​dc073df `fixes for trac #30446` ​4a5d053 `doctests for trac 28620, 30304, 30786`

### comment:7 Changed 23 months ago by Travis Scrimshaw

Reviewers: → Travis Scrimshaw needs_review → positive_review

LGTM.

Thanks!

### comment:9 Changed 22 months ago by Dima Pasechnik

Status: positive_review → needs_work

rebase over new #30446

### comment:10 Changed 22 months ago by git

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

 ​9d747fc `sage --package update-latest: Distinguish pypi package name and spkg name` ​f74f66c `sage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages` ​182b3d2 `sage -package fix-checksum: Handle package classes, ignore non-normal packages` ​9a57cf6 `pynac update` ​563940e `doctest from #30446` ​51def3c `sane version name` ​4834dc8 `remove upstreamed patch` ​214712d `tarball update` ​6ee3113 `doctests for trac 28620, 30304, 30786`

### comment:11 Changed 22 months ago by Dima Pasechnik

Reviewers: Travis Scrimshaw → Travis Scrimshaw, Dima Pasechnik needs_work → positive_review

OK, done

### comment:12 Changed 21 months ago by Volker Braun

Branch: public/30786 → 6ee3113a288a36519ed1a4b0adbd19250404874b → fixed positive_review → closed
Note: See TracTickets for help on using tickets.