I'm building a symbolic derivative engine. For example
let f = <@ fun x:double -> x * x @>
let df = der f
and the resulting expression will be
<@ 2 * x @>
The actual equations could be arbitrarily complex.
The generation of the derivatives are not too hard using recursive pattern matching and transformations but in the end I want to use the generated equations in tight numerical loops as if I had hand written them. This is numerical computing code so faster is always better ( if possible )
I've looked at the FSharpX quotation compiler but it looks like an interpreter rather than a compiler.