> Unfortunately, this would require an entirely new set of fvar_vec
> implementations. The good news is that they're all just vectorized
> versions of what we already have. And we can use the non-vector versions
> for testing.
>
> Of course, we could also unfold the higher-order derivatives in this
> situation, but I can't bear to think of the bookkeeping.
That's what LaTeX is for! In convincing myself of how to specialize our existing functions
I went through a general derivation that should also hold for vectorized implementations
like this.
Actually, the derivation is pretty clean and it wouldn't be hard to create an operands_and_partials-like
interface where we implement the function value, gradient, Hessian, and third-derivatives and the
specializations can be automated (well, conceptually at least). None of those would have to be
computed twice, although we wouldn't be able to take advantage of common terms unless we wrote
it by hand.