Dual numbers and hyperdual space¶
Dual number theory¶
Dual numbers are a type of complex numbers. The ubiquitous set of complex numbers,
Similarly, we may define the set of dual numbers as follows, where
Moreover, for
An auto-differentiation property emerges from the addition of this nilpotent element, as is obvious from a Taylor series expansion. Evidently, this result is only valid for values of
By choosing
Hyperdual spaces¶
We can further extend the dual numbers to a hyperdual space. Let us define a hyperdual space of size 2 as follows, where
This mathematical tool enables auto-differentiation of multi-variate functions as follows, where
Example¶
Let us detail a computation example of a smooth multivariate polynomial function defined over all reals.
Let us extend the definition of this function to
Trivially,
Hence,
As expected, the
Computation¶
All hyperdual computations are handled by the hyperdual Rust crate, co-authored by Chris Rabotin.