num-dual
Generalized, recursive, scalar and vector (hyper) dual numbers for the automatic and exact calculation of (partial) derivatives. Including bindings for python.
Installation and Usage
Python
The python package can be installed directly from PyPI:
pip install num_dual
Rust
Add this to your Cargo.toml
:
[]
= "0.4"
Example
Python
Compute the first and second derivative of a scalar-valued function.
return /
=
=
Rust
This example defines a generic function that can be called using any (hyper) dual number and automatically calculates derivatives.
use *;
Documentation
- You can find the documentation of the rust crate here.
- The documentation of the python package can be found here.
Python
For the following commands to work you have to have the package installed (see: installing from source).
cd docs
make html
Open _build/html/index.html
in your browser.