Symbolics.jl icon indicating copy to clipboard operation
Symbolics.jl copied to clipboard

simplify not properly working for middle factors

Open sw2030 opened this issue 4 years ago • 0 comments

I found that simplify does not work for the parts that are not the first or the last part of homogeneous factors.

Here's an example:

julia> using Symbolics

julia> @variables x, y, z
3-element Vector{Num}:
 x
 y
 z

julia> simplify( cos(x)^2*cos(y)^2*cos(z)^2 + sin(x)^2*cos(y)^2*cos(z)^2 )
(cos(y)^2)*(cos(z)^2)

julia> simplify( cos(x)^2*cos(y)^2*cos(z)^2 + cos(x)^2*sin(y)^2*cos(z)^2 )
(cos(x)^2)*(cos(y)^2)*(cos(z)^2) + (cos(x)^2)*(sin(y)^2)*(cos(z)^2)

julia> simplify( cos(x)^2*cos(y)^2*cos(z)^2 + cos(x)^2*cos(y)^2*sin(z)^2 )
(cos(x)^2)*(cos(y)^2)

You can see the second simplify did not work properly.

┆Issue is synchronized with this Trello card by Unito

sw2030 avatar Dec 23 '21 22:12 sw2030