Skip to content

simplify produces non-equivalent expression #1554

Open
@stromberger

Description

@stromberger

Using Julia 1.11.4 (arm64, macOS) and Symbolics.js 6.40.0. I would expect that applying simplify to a symbolic expression yields an equivalent expression. However:

MRE

f1(in0,in1,in2) = ((((ifelse((11 >= in2), ifelse(true, in0, in2), (34 - 57)) ^ 3) / ((ifelse(false, in2, in2) - (53 + in0)) / (ifelse(true, in0, in1) - in0))) ^ 2) / (((((in2 ^ 3) + (in1 ^ 3)) - 12) / (((in2 * in0) ^ 2) / 116)) * ((((0 - in1) + (in0 + in1)) / in2) / (((in1 * 96) + (in1 * in2)) - ((in1 ^ 3) / (in1 * in0))))))

using Symbolics
@variables a, b, c

@info simplify(simplify(f1(a, b, c)) - f1(a, b, c))

Output:

[ Info: 2 / (-12 + b^3 + c^3)

Expected:
simplify(f1(a, b, c)) - f1(a, b, c) should be equivalent to 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions