File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 5151 @rule (~ x / ~ y => ~ x * pow (~ y, - 1 ))
5252 @rule (one (~ x) => one (symtype (~ x)))
5353 @rule (zero (~ x) => zero (symtype (~ x)))
54+ @rule (conj (~ x:: _isreal ) => ~ x)
55+ @rule (real (~ x:: _isreal ) => ~ x)
5456 @rule (ifelse (~ x:: is_literal_number , ~ y, ~ z) => ~ x ? ~ y : ~ z)
5557 ]
5658
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ is_literal_number(x) = isliteral(Number)(x)
115115_iszero (x) = x isa Number && iszero (x)
116116_isone (x) = x isa Number && isone (x)
117117_isinteger (x) = (x isa Number && isinteger (x)) || (x isa Symbolic && symtype (x) <: Integer )
118+ _isreal (x) = (x isa Number && isreal (x)) || (x isa Symbolic && symtype (x) <: Real )
118119
119120issortedₑ (args) = issorted (args, lt= < ₑ)
120121needs_sorting (f) = x -> is_operation (f)(x) && ! issortedₑ (arguments (x))
Original file line number Diff line number Diff line change 1818
1919@testset " Numeric" begin
2020 @syms a:: Integer b c d x:: Real y:: Number
21+ @eqtest simplify (conj (x)) == x
22+ @eqtest simplify (real (x)) == x
2123 @eqtest simplify (x - y) == x + - 1 * y
2224 @eqtest simplify (x - sin (y)) == x + - 1 * sin (y)
2325 @eqtest simplify (- sin (x)) == - 1 * sin (x)
You can’t perform that action at this time.
0 commit comments