Dual Numbers for Arbitrary Order Automatic Differentiation
Authors:
F. Peñuñuri,
K. B. Cantún-Avila,
R. Peón-Escalante
Abstract:
Dual numbers are a well-known tool for computing derivatives of functions. While the theoretical framework for calculating derivatives of arbitrary order is well established, practical implementations remain less developed. One notable implementation is available in the Julia programming language where dual numbers are designed to be nested, enabling the computation of derivatives to arbitrary ord…
▽ More
Dual numbers are a well-known tool for computing derivatives of functions. While the theoretical framework for calculating derivatives of arbitrary order is well established, practical implementations remain less developed. One notable implementation is available in the Julia programming language where dual numbers are designed to be nested, enabling the computation of derivatives to arbitrary order. However, this approach has a significant drawback as it struggles with scalability for high-order derivatives. The nested structure quickly consumes memory, making it challenging to compute derivatives of higher orders. In this study, we introduce DNAOAD, a Fortran-based implementation of automatic differentiation capable of handling derivatives of arbitrary order using dual numbers. This implementation employs a direct approach to represent dual numbers without relying on recursive or nested structures. As a result, DNAOAD facilitates the efficient computation of derivatives of very high orders while addressing the memory limitations of existing methods.
△ Less
Submitted 7 January, 2025;
originally announced January 2025.
A dual number formulation to efficiently compute higher order directional derivatives
Authors:
R. Peón-Escalante,
K. B. Cantún-Avila,
O. Carvente,
A. Espinosa-Romero,
F. Peñuñuri
Abstract:
This contribution proposes a new formulation to efficiently compute directional derivatives of order one to fourth. The formulation is based on automatic differentiation implemented with dual numbers. Directional derivatives are particular cases of symmetric multilinear forms; therefore, using their symmetric properties and their coordinate representation, we implement functions to calculate mixed…
▽ More
This contribution proposes a new formulation to efficiently compute directional derivatives of order one to fourth. The formulation is based on automatic differentiation implemented with dual numbers. Directional derivatives are particular cases of symmetric multilinear forms; therefore, using their symmetric properties and their coordinate representation, we implement functions to calculate mixed partial derivatives. Moreover, with directional derivatives, we deduce concise formulas for the velocity, acceleration, jerk, and jounce/snap vectors. The utility of our formulation is proved with three examples. The first example presents a comparison against the forward mode of finite differences to compute the fourth-order directional derivative of a scalar function. To this end, we have coded the finite differences method to calculate partial derivatives until the fourth order, to any order of approximation. The second example presents efficient computations of the velocity, acceleration, jerk, and jounce/snap. Finally, the third example is related to the computation of some partial derivatives. The implemented code of the proposed formulation and the finite differences method is proportioned as additional material to this article.
△ Less
Submitted 13 June, 2023;
originally announced June 2023.