StaticCompiler: Debugging and calling basic math functions

Okay, so your solution did indeed work for the simple testcase :-). On top, i learned that i can use cis instead of exp and that this will supposedly be faster too (i only have exp(i*real_a) calls).

I also found another variety of the cis-function in this forum post which is less extra code and allegedly faster because it calls some optimized library.

const A = Ref{Cdouble}()
const B = Ref{Cdouble}()
function cis2_(x::Float64)
    ccall((:sincos, Base.Math.libm), Cvoid, (Cdouble, Ptr{Cdouble}, Ptr{Cdouble}), x, A, B)
    return Complex(B, A)
end

Sadly this will simply give me a segfault when compiled (it works inside julia). I suspect that the calls to Ref{CDouble}() amount to GC memory allocation calls. I would have thought that this could also be circumvented, since A and B are no arrays and it should be possible to pass memories to some scalar value. Sadly i did not manage to implement any version of my idea which would work even in normal julia (syntax errors).