In the DirectX SDK (June 2010) release, the HLSL compiler was updated from the August 2009 version. As part of this update, the HLSL complier now supports a new feature: symbolic derivatives. If you are interested in learning more about what this feature is and what you can do with it, you should check out this paper from Microsoft Research: Symbolic Differentiation in GPU Shaders
Update: The researcher’s home page contains more information and the sample is on the MSR download site. Note that the tools make use of the XNA Game Studio 3.1 assemblies, and the redistributable package can be obtained directly from MS Downloads.
There is also a Game Developer Conference 2011 presentation on this topic.