Symbolics.jl
Symbolics.jl copied to clipboard
Arrays of symbolic terms break basic arithmetic
The following does not work:
using Symbolics
function proj(x)
return x[1:end-1] ./ x[end]
end
@variables x[1:3] s
println(proj(x)) # (broadcast(/, x[1:2], Ref(x[3])))[1:2]
println(proj(x * s)) # ERROR: MethodError: no method matching length(::SymbolicUtils.Term{Any, Nothing})
I would expect this to be fine.
I'm using Symbolics v4.10.3
Also failing:
using Symbolics
@variables x[1:2] s
(x[1] * s) / (x[2] * s) # Works
y = x .* s
z = y[1] / y[2] # ERROR: MethodError: no method matching /(::SymbolicUtils.Term{Any, Nothing}, ::SymbolicUtils.Term{Any, Nothing})
It seems #696 fixed this.