Ask Your Question

Revision history [back]

I believe that fast_callable produces, and then compiles, C code under the hood; the object you get back from fast_callable is a wrapper around a foreign function call and hence can't be saved and restored by Python/Sage (see http://docs.python.org/2/library/pickle.html).

On the other hand, you can have Sage (via sympy) generate C code for a function that provides evaluation of your expression on C doubles. I gave a short example of this on this question:

http://ask.sagemath.org/question/366/export-to-c-code?answer=3183#3183

It may also be possible to convert your expression into a python function and send that through the Cython compiler to produce compiled C code with a direct interface in Sage... I don't know if that's possible in your situation or not.