5 ms·
I worked with GiNaC https://www.ginac.de/ https://www.ginac.de/ and noticed that the bottleneck was variable substitutions, e.g., replace a variable with a cons
by tomdre 9y ago
I worked with GiNaC https://www.ginac.de/ https://www.ginac.de/ and noticed that the bottleneck was variable substitutions, e.g., replace a variable with a constant and simplify the expression. I'm still dreaming of an efficient CAS.
- dsharlet 9y agohttps://github.com/dsharlet/ComputerAlgebra https://github.com/dsharlet/ComputerAlgebra (disclaimer: my project) might do what you want, it lets you manipulate expressions and then compile them to "native" .net functions that can be evaluated with high performance.
- tomdre 9y agoThanks! I'll have a look at it for sure. During my phd I developed a tool for reachability analysis of polynomial dynamical systems https://github.com/dreossi/sapo https://github.com/dreossi/sapo I needed expression manipulation to compute Bernestein coefficients of polynomials
- ibluesun 9y agoafter parsing the symbolic calculations you can execute them as a normal function call in case of single variable for example var result = SymbolicVariable.Parse("sin(3*x)").Execute(2); in case of multi variables you can send the values based on their alphabet order var d = SymbolicVariable.Parse("a^b^c"); Assert.AreEqual("a^(b^c)", d.ToString()); var r = d.Execute(3, 2, 4); Assert.AreEqual(43046721.0, r); or by assigning them to a dictionary of Dictionary<string, double>