Shashi Gowda

Results 371 comments of Shashi Gowda

Absolutely fantanstic!! I'm excited. It might be good to add a Symutils -> IR conversion given a vector of arguments.

> Mjolnir is also happy tracing through array/linalg code; I'm not sure what this package's support for arrays looks like, but if there's an example I'd be happy to demo...

```julia julia> using SymbolicUtils julia> @syms a b c (a, b, c) julia> ir=IR(a+b+c, [a,b]; mod=Main) 1: (%1, %2) %3 = (+)(%1, %2, Main.c) return %3 julia> h=func(ir) ##260 (generic...

made the macro use values from the current env (if symbols are passed, uses the `symtype` to trace, everything else is a Const). this lets you call stuff with anything:...

> world age ```julia julia> function make_and_call(expr, args, vals) func(IR(expr, args))(vals...) end julia> make_and_call(a+b, [a,b], [1,2]) ERROR: MethodError: no method matching ##261(::Int64, ::Int64) The applicable method may be too new:...

```julia using SymbolicUtils using ModelingToolkit using ModelingToolkit: expand_derivatives, to_mtk using SymbolicUtils: to_symbolic function D(f, T; simplify=true) @syms t()::T @derivatives DD'~to_mtk(t()) expr = @symbolic f(t()) deriv_expr = to_symbolic(expand_derivatives(DD(to_mtk(expr)), simplify)) @show deriv_expr...

@MikeInnes I just added a fuzzer for Mjolnir if you're interested in having a look (only constructs simple functions from SymbolicUtils exprs): ```julia julia> include("test/fuzzlib.jl") fuzz_test (generic function with 1...

>(trig rules for example aren't always important). I think there's a quick check to see if we need the rules in the first place. But simplify is inherently slow because...

why do you even need simplify in the first place? ;) Isn't the canonical form good enough for your use case? Most of the rules are redundant, and are for...

Yeah at some point you have to treat symbolic expressions as black box and stop looking at how pretty it is, just compile and run it!