Python bindings for num-dual: Generalized (hyper) dual numbers for the calculation of exact (partial) derivatives
Project description
dualnum
Python bindings for the num-dual
rust crate.
Installation
pip install dualnum
Installation from source
To install from source, you need to have the rust compiler installed.
pip install git+https://github.com/itt-ustutt/dualnum
Sphinx documentation
To build the documentation with sphinx:
maturin develop --release
cd docs
make html
make doctest
firefox _build/html/index.html
Usage
Compute first and second derivative of a scalar valued function.
from dualnum import derive2
import numpy as np
def f(x):
return np.exp(x) / np.sqrt(np.sin(x)**3 + np.cos(x)**3)
x = derive2(1.5)
result = f(x)
print('f(x) = {}'.format(result.value))
print('df/dx = {}'.format(result.first_derivative))
print('d2f/dx2 = {}'.format(result.second_derivative))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for dualnum-0.2.1-cp36-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cffffcb1865c1eabbd7a2971e07f5439195419d75bc499a2cec522a9ca11cd46 |
|
MD5 | 4723060a52e142cbe90379d5be92cd45 |
|
BLAKE2b-256 | f9f73d340629613812711365687d3b316a08788a44ea7ad502e668965cf1673d |
Close
Hashes for dualnum-0.2.1-cp36-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df3100ce04ff0578fed92c010ce2686aae2f69fea207a8ecfd882d5ce2f27860 |
|
MD5 | 7f95288189dff820943b571a8d6d0e3d |
|
BLAKE2b-256 | 54b744ce5707153942af84545730b31c53b5f10f21ab713779fdaf7b37890d2e |
Close
Hashes for dualnum-0.2.1-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43b6ed6d4fb5c2426f9933acfc314cf26630247cb1dabd897d5208b2cad8a5f |
|
MD5 | b410cc8378238340ee08c794c2321f7e |
|
BLAKE2b-256 | 3d1ff2ca42ecd1a2c51b390c6e6acd10ddc10592272eab35c89a70e664fef661 |
Close
Hashes for dualnum-0.2.1-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3300699ed4f70eb0b17dfe0bad9b9b3f63aa92adfe916534f5ddbe623ca27191 |
|
MD5 | 12cf9ef609670d1fffc27b3f5e986852 |
|
BLAKE2b-256 | a93a9aa7f047e362d41f0a121e4fabdcc8037749883e22a17647f575912b875b |
Close
Hashes for dualnum-0.2.1-cp36-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee482b73d51fa611278be6763f85033113a1773c15751651d5569410f8d80b55 |
|
MD5 | 82daa3c525fbde2bec9d953e5f072818 |
|
BLAKE2b-256 | 89bd33aa0b4d01e56a747b35930d81ec7b614cf5a5afe88af854b45d26096a37 |