Computes the differences between adjacent elements in an array of values.