Working forward and reverse for vector function