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

Strange behavior of simplify. #805

Closed
PhyX-Meow opened this issue Dec 13, 2022 · 2 comments
Closed

Strange behavior of simplify. #805

PhyX-Meow opened this issue Dec 13, 2022 · 2 comments

Comments

@PhyX-Meow
Copy link

PhyX-Meow commented Dec 13, 2022

Hello, I'm using Symbolics.jl to do some expression calculation, but today I found simplify function not work in case.
Run these code

@variables x,y,z

f = 4/(1-x^2-y^2-z^2)^2
D = Differential(x)

fx = D(f) |> expand_derivatives |> simplify

gives

2x*(2 - 2(x^2) - 2(y^2) - 2(z^2))*(4 / ((1 - (x^2) - (y^2) - (z^2))^4))

The fraction is not canceled

However after I copy and paste then do simplify again:

julia> 2x*(2 - 2(x^2) - 2(y^2) - 2(z^2))*(4 / ((1 - (x^2) - (y^2) - (z^2))^4)) |> simplify
(16.0x) / ((1 - (x^2) - (y^2) - (z^2))^3)

One see the desired fraction cancelation.
What's wrong here, shouldn't they be the same expression?

@PhyX-Meow
Copy link
Author

Forgot to say:
Julia version 1.8.3
Symbolics v4.13.0

@PhyX-Meow
Copy link
Author

Well...This seems to be fixed in latest version. Closing...

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

1 participant