Up front, my question is whether symengine is a good tool for what I want to do, or if I would be better served by something like sympy or mathematica.
I need to evaluate functions based on symbolic manipulations in a reasonably performant manner (comparable to basic, serial fortran code, for instance). I've done this before in sympy, and the workflow looked like this:
- Provide an input symbolic expression
- Perform a predetermined set of manipulations, including algebra and calculus
- Simplify the result
- Generate code (either python or C) and compile
- Use this generated code in my numerical PDE solver (inside the tightest loop)
I wasn't super happy with how fiddly this workflow was. In particular, I'd like to consolidate this whole process into the initial setup of the PDE solver, rather than have multiple compile and link steps. Since I'm writing a new PDE solver, I thought I'd try to incorporate this all into the base code, hopefully to simplify the process for the end-user.
Is symengine a good choice for something like this? I see a code printer. I'd like to compile and link to the code at runtime; I suppose I'd have to handle that myself? Any other ideas, based on my description of the problem?
Thanks for your help,