Symbolic Differentiation
In addition to AD, the DiffSharp library also implements symbolic differentiation, which works by the symbolic manipulation of closedform expressions using rules of differential calculus.
For a complete list of the available differentiation operations, please refer to API Overview and API Reference.
DiffSharp.Symbolic
This is a symbolic differentiation module, used with the Expr type representing F# code expressions. A common way of generating F# code expressions is to use code quotations, with the <@ and @> symbols delimiting an expression.
Symbolic differentiation operators construct the wanted derivative as a new expression and return this as a compiled function that can be used subsequently for evaluating the derivative. Once the derivative expression is compiled and returned, it is significantly faster to run it with specific numerical arguments, compared to the initial time it takes to compile the function. You can see example compilation and running times on the Benchmarks page.
1: 2: 3: 4: 5: 6: 7: 8: 

Function definitions should be marked with the ReflectedDefinition attribute for allowing access to quotation expressions at runtime.
1: 2: 3: 4: 5: 6: 

Different from the DiffSharp.AD and DiffSharp.Numerical parts of the library, multivariate functions are expected to be in curried form.
1: 2: 3: 4: 5: 6: 

Functions can be marked with the ReflectedDefinition attribute one by one, or they can be put into a module marked with this attribute to make it apply to all.
Differentiation operations will delve into the definition of any other function referenced from a given function (the referenced function will be inlined into the body of the calling function), as long as they have the ReflectedDefinition attribute.
1: 2: 3: 4: 5: 6: 7: 8: 9: 

from DiffSharp.Symbolic
Full name: Gettingstartedsymbolicdifferentiation.d
Full name: DiffSharp.Symbolic.Float64.DiffOps.diff
Full name: Microsoft.FSharp.Core.Operators.sin
Full name: Microsoft.FSharp.Core.Operators.sqrt
Full name: Gettingstartedsymbolicdifferentiation.d2
type ReflectedDefinitionAttribute =
inherit Attribute
new : unit > ReflectedDefinitionAttribute
new : includeValue:bool > ReflectedDefinitionAttribute
member IncludeValue : bool
Full name: Microsoft.FSharp.Core.ReflectedDefinitionAttribute

new : unit > ReflectedDefinitionAttribute
new : includeValue:bool > ReflectedDefinitionAttribute
Full name: Gettingstartedsymbolicdifferentiation.f
Full name: Gettingstartedsymbolicdifferentiation.df
Full name: Gettingstartedsymbolicdifferentiation.g
Full name: Gettingstartedsymbolicdifferentiation.gg
Full name: DiffSharp.Symbolic.Float64.DiffOps.grad
from Gettingstartedsymbolicdifferentiation
Full name: Gettingstartedsymbolicdifferentiation.m.f
Full name: Gettingstartedsymbolicdifferentiation.m.g
Full name: Gettingstartedsymbolicdifferentiation.hg
Full name: DiffSharp.Symbolic.Float64.DiffOps.hessian