Second try on "heurisch_diff"

This is second try on making special derivatives for heurisch avaiable.
Implementation as discussed with @asmeurer, thank you.