Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in simplify_fractions? #487

Closed
jmsull opened this issue Dec 30, 2021 · 3 comments
Closed

bug in simplify_fractions? #487

jmsull opened this issue Dec 30, 2021 · 3 comments

Comments

@jmsull
Copy link

jmsull commented Dec 30, 2021

Not sure this is exactly the place for this, but I am finding a problem with simplify_fractions.

In particular, using simplify_fractions on a simple example gives the wrong answer (in v1.7.0):

using Symbolics
@variables x y
z = 1 + (1 - x)*y^2 / (2*(1 - x))
simplify_fractions(z)

the above returns 1//0, but should return 1 + 1//2 y^2.

Maybe this is helpful for finding the issue, but there is no problem if I drop the 2 in the denominator (or the 1 + at the front, or use y instead of y^2, or use x instead of 1-x).

This may be related to the most recent comment in JuliaSymbolics/SymbolicUtils.jl#380?

@shashi
Copy link
Member

shashi commented Jan 17, 2022

Seems to be from DynamicPolynomials...

(ns[i]).p = -xy² + y² - 2x + 2
(ds[j]).p = -2x + 2
gcd((ns[i]).p, (ds[j]).p) = -xy² + y² - 2x + 2

cc @blegat

@shashi
Copy link
Member

shashi commented Jan 20, 2022

Fixed by DynamicPolynomials.jl v0.4.2

@shashi shashi closed this as completed Jan 20, 2022
@jmsull
Copy link
Author

jmsull commented Jan 20, 2022

Great - thank you for tracking this down!

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

No branches or pull requests

2 participants