Efficient Differentiable Programming in a Functional Array-Processing Language