From 1acb9c2d13f03a9a55a2e456230940a93881cab5 Mon Sep 17 00:00:00 2001 From: Omar Elrefaei <17922991+Omar-Elrefaei@users.noreply.github.com> Date: Wed, 31 Aug 2022 03:35:53 -0400 Subject: [PATCH] Simplify trivial ifelse cases. Fix JuliaSymbolics/Symbolics.jl#170 --- src/simplify_rules.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/simplify_rules.jl b/src/simplify_rules.jl index 9ebfb5ee7..5845adea9 100644 --- a/src/simplify_rules.jl +++ b/src/simplify_rules.jl @@ -54,6 +54,7 @@ let @rule(real(~x::_isreal) => ~x) @rule(imag(~x::_isreal) => zero(symtype(~x))) @rule(ifelse(~x::is_literal_number, ~y, ~z) => ~x ? ~y : ~z) + @rule(ifelse(~x, ~y, ~y) => ~y) ] TRIG_EXP_RULES = [