Symbolic Differentiation in HLSL Shaders
microsoft.com