Simplified version of DiffFunction. Need to adapt tests.
Tests adapted to simplified DiffFunction. Tests makefile might not be quite right with dependencies.