mod derivative

It's to take the derivative of the mod operator, e.g. when the first argument is an angle variable.

It wasn't obvious to me how to add a proper unit test, but here's a test script:
https://gist.github.com/joschu/7443684