Matrixfied - equivalent to gdd_calc_binned but without inner loop