Skip to content

Commit

Permalink
Update how_it_works.md
Browse files Browse the repository at this point in the history
Adding code for forming nested duals in the docs so folks don't make the mistakes I made in #671
  • Loading branch information
vpuri3 authored Nov 15, 2023
1 parent d300209 commit a9019e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/dev/how_it_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ learn about [hyper-dual numbers](https://arc.aiaa.org/doi/abs/10.2514/6.2011-886
which extend dual numbers to higher orders by introducing extra ``\epsilon`` terms that can
cross-multiply. ForwardDiff's `Dual` number implementation naturally supports hyper-dual
numbers without additional code by allowing instances of the `Dual` type to nest within each
other. For example, a second-order hyper-dual number has the type `Dual{T,Dual{S,V,M},N}`, a
third-order hyper-dual number has the type `Dual{T,Dual{S,Dual{R,V,K},M},N}`, and so on.
other. For example, a second-order hyper-dual number has the type `Dual{T,Dual{S,V,M},N}`,
and can be formed as follows: `Dual(Dual(x, one(eltype(x))), one(eltype(x)))`. Athird-order
hyper-dual number has the type `Dual{T,Dual{S,Dual{R,V,K},M},N}`, and so on.

## ForwardDiff's API

Expand Down

0 comments on commit a9019e9

Please sign in to comment.