# SymEngine - turn to function

**URL:** <https://discourse.julialang.org/t/symengine-turn-to-function/28907>\
**Category:** New to Julia\
**Created:** [September 18, 2019, 6:25pm UTC](https://discourse.julialang.org/t/symengine-turn-to-function/28907 "2019-09-18T18:25:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [September 18, 2019, 6:46pm UTC](https://discourse.julialang.org/t/symengine-turn-to-function/28907/2 "2019-09-18T18:46:39Z")

</div>

I’ve found this temporary solution:

> [@Creating Julia function from a symbolic expression (using SymEngine)](https://discourse.julialang.org/t/creating-julia-function-from-a-symbolic-expression-using-symengine/21476):
>
> Hello, what would be a good way to define a Julia function based on the result of symbolic calculations? For the moment, using lambdify in SymEngine gives a rather slow result, as compared to “brute force” parsing of the SymEngine output: using SymEngine @vars x # Complicated symbolic expression here symf = x fl = lambdify(symf, [x]) eval(Meta.parse("fm(x)="\*SymEngine.toString(symf))) This defines two functions fl and fm which evaluate the expression in symf. However, the variant with par…

```julia
Bf = lambdify(Bmat, [x,y,a,b])

```

But according to the post it might be slow. It works atleast.

Kind regards, if someone else have a better solution I would love to hear

---

_[View the full topic](https://discourse.julialang.org/t/symengine-turn-to-function/28907)._
