Consider the simple code which defines a function of x
using build_function
using Symbolics
@variables x
expr = exp(im*x)*cos(x)
# The option expression=Val{false} is supposed to force numerical evaluation.
f = build_function(expr, [x], expression=Val{false})
# Try to call the generated function with a numerical value.
result = f(0.8)
println("Result: ", result)
Ideally the result should be 0.48540023884935557 + 0.49978680152075255im
but I get the output in terms of the symbolic variable Result: cos(x)^2 + im*sin(x)*cos(x)
I want the code to finally output a number. How can I fix this?