The analytic gradient checks out.