Your function is wild, https://gist.github.com/ChrisRackauckas/d0d0324c5c7bcef6012ed12a03e35859, hundred thousand characters or so. That’s why it takes so long to compile. Is this expected?
Note that A/b is a linear solve. If those are supposed to be element-wise, then they need a dot: A ./ b.
julia> b = [0.5 0.2]
1×2 Matrix{Float64}:
0.5 0.2
julia> A = [1 1
1 1]
2×2 Matrix{Int64}:
1 1
1 1
julia> A / b
2×1 Matrix{Float64}:
2.413793103448275
2.413793103448275
julia> A ./ b
2×2 Matrix{Float64}:
2.0 5.0
2.0 5.0
If you’re doing A / b and that’s what you mean, then of course it needs to calculate the lu-factorization or inverse of A, which is what grows the equation size and the symbolic expression.
If you’re looking to do this over inversions, then you will need to use automatic differentiation because of the expression growth.