These are chat archives for symengine/symengine

Jul 2016
Spencer Lyon
Jul 18 2016 09:09

Thanks @srajangarg

I have finally found time to write down my question, here it goes.

I am building a Julia library that, among other things, will take a system of
equations either from strings (commonly read from a file) or as julia Exprs
and output a Julia function to evaluate the system of equations or any of its
higher order derivatives. Right now I am using Calculus.jl to take the
derivatives and am finding that this is a huge bottleneck in my code.

I did some preliminary testing and found that after loading the equations into
symengine, using symengine to compute the derivatives is about 3 orders of
magnitude faster!

What I would like to do is the following: find an efficient way to move from
Julia Exprs to symengine Basics and then differentiate the Basics with
respect to specific symbols. The symbols are currently Julia Symbols

Does anyone here have any tips or guidelines I can follow to make this process
as efficient as possible?

Spencer Lyon
Jul 18 2016 12:09
We can assume that I am able to go from Julia Expr or Symbol to a string efficiently.
Isuru Fernando
Jul 18 2016 20:26
@spencerlyon2 is basic_parse too slow? What kind of Expr s do you use? What you can do is add an expression you want to parse to our benchmark suite and then we can figure out how to speed it up
Spencer Lyon
Jul 18 2016 20:27
I think I’ll have to do some benchmarking to tell if basic_parse is too slow.

Is there a way to do something like this (in pseudocode)

s = basic_parse(my_string)
diff(s, “foo”)

Where foo is a symbol that appears in my_string?