ft of functions for gradient computation