Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

solveEquation with negative power causes infinite loop #228

Open
BrandiATMuhkuh opened this issue Dec 19, 2017 · 1 comment
Open

solveEquation with negative power causes infinite loop #228

BrandiATMuhkuh opened this issue Dec 19, 2017 · 1 comment

Comments

@BrandiATMuhkuh
Copy link

It turns out that the following equation x^-2 + x^-1 = x causes a Math error: Potential infinite loop for equation: error. However, when I change the equation to 1/x^2 + 1/x^1 = x I don't get the error (FYI: 1/x^2 + 1/x^1 == x^-2 + x^-1).

here are some more trials where I ran into the same problem

  • x^-2 + x^-1= x
  • x^-2 + x^-1 + x^0 = x^1 + x^2
  • x^-2 + x^-1 + x^0 = x^2 + x^1
  • x^-1 + x^-2 + x^0 = x^2 + x^1
  • x^0 + x^-1 + x^-2= x^1 + x^2

I ran solveEquation with the debug flag, and it seems like the solver does not remember if it has already reached a step and loops forever.

Here is an illustration to tell you what I mean with that:
We are mathematically allowed to do the follow:

  • 1 + 1 = x
  • 1 = x - 1
  • 1 + 1 = x
  • 1 = x - 1
  • 1 + 1 = x
  • 1 = x - 1
  • ...

I believe you get my point (infinite loop).

I suspect that solveEquation is stuck in such a case.

@evykassirer
Copy link
Contributor

Hi! Thanks for reporting this :) Definitely not the behaviour we'd like haha - I know there are a few known ways things infinitely loop that are tricky to fix, but am not sure if this is one of those known issues.

I'm currently working on a conference that's happening in a few weeks and don't have bandwidth to look into this, but I encourage you to dig into the code and find more info about the issue or even a fix. I'd be happy to look into it in mid January as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants