Roberts' gradient implementation