Skip to content

Commit fd2d4a9

Browse files
authored
Update how_it_works.md (#672)
Adding code for forming nested duals in the docs so folks don't make the mistakes I made in #671
1 parent 64e9f65 commit fd2d4a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/src/dev/how_it_works.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ learn about [hyper-dual numbers](https://arc.aiaa.org/doi/abs/10.2514/6.2011-886
5656
which extend dual numbers to higher orders by introducing extra ``\epsilon`` terms that can
5757
cross-multiply. ForwardDiff's `Dual` number implementation naturally supports hyper-dual
5858
numbers without additional code by allowing instances of the `Dual` type to nest within each
59-
other. For example, a second-order hyper-dual number has the type `Dual{T,Dual{S,V,M},N}`, a
60-
third-order hyper-dual number has the type `Dual{T,Dual{S,Dual{R,V,K},M},N}`, and so on.
59+
other. For example, a second-order hyper-dual number has the type `Dual{T,Dual{S,V,M},N}`,
60+
and can be formed as follows: `Dual(Dual(x, one(eltype(x))), one(eltype(x)))`. A third-order
61+
hyper-dual number has the type `Dual{T,Dual{S,Dual{R,V,K},M},N}`, and so on.
6162

6263
## ForwardDiff's API
6364

0 commit comments

Comments
 (0)