Generalized dual numbers for efficient computation of arbitrary-order directional derivatives in multiple directions
This repository provides a Fortran implementation for the efficient computation of arbitrary-order directional derivatives in multiple directions using generalized dual numbers.
This project implements a generalized dual number framework for computing directional derivatives of arbitrary order along multiple directions. The approach is designed to be efficient and scalable, making it suitable for applications in kinematics, optimization, and automatic differentiation.
The implementation supports the computation of directional derivatives of arbitrary order along multiple independent directions, based on a generalized dual number algebra.
src/--- Fortran source modulesapp/--- Executable programsdocs/--- Additional documentation and API descriptionsfpm.toml--- Project configuration file
- A Fortran compiler, such as
gfortranorifx - A recent version of
fpmis recommended
To install fpm, visit:
👉 https://github.com/fortran-lang/fpm
Although this project is designed to be built conveniently with fpm,
the use of fpm is not strictly required. If fpm is not used, the
source files must be compiled and linked manually in the correct order,
taking into account the module dependencies among the Fortran source
files. In addition, preprocessor flags (e.g., -cpp, -DUSE_REAL128,
-DMAX_ORDER_DUALZN=<N>) may be required depending on the desired
configuration.
From the project root:
fpm buildFor example, using Intel Fortran:
FPM_FC=ifx fpm buildTo enable quadruple precision (real128), compile with:
fpm run --flag "-DUSE_REAL128" <executable_name>For example:
fpm run --flag "-DUSE_REAL128" partialD_funBy default, MAX_ORDER_DUALZN = 5.
The example EA1 requires a minimum order of 7:
fpm run --flag "-DMAX_ORDER_DUALZN=7" EA1Other examples can be executed directly, for instance:
fpm run RCR_KQs- The maximum derivative order is controlled at compile time via the
MAX_ORDER_DUALZNflag. - Increasing this value allows higher-order derivatives but may increase memory usage and computational cost.
This repository is under active development and is intended to support a research article currently in preparation and submission.