A package for dual number-based automatic differentiation
Project description
rsr45-dual-autodiff-x
rsr45-dual-autodiff-x is a Python package that provides an efficient and user-friendly implementation of automatic differentiation using dual numbers. The package is optimized with Cython for enhanced performance and is particularly useful for tasks requiring derivatives, such as optimization, machine learning, and numerical simulations.
Features
- Dual Number Arithmetic: Supports basic operations like addition, subtraction, multiplication, and division with dual numbers.
- Mathematical Functions: Includes trigonometric, exponential, logarithmic, and other advanced functions for dual numbers.
- Automatic Differentiation: Computes derivatives automatically as a natural byproduct of dual number operations.
- Cython Optimization: Improved performance for computationally intensive tasks.
- Cross-Version Support: Compatible with Python 3.10 and 3.11.
Installation
Using pip
Install the package directly from PyPI:
pip install rsr45-dual-autodiff-x
Usage
Importing the Package
To use the package:
import dual_autodiff as df
from dual_autodiff.dual import Dual
from dual_autodiff.functions import sin, cos, log
Creating Dual Numbers
x = Dual(2, 1) # Represents the dual number 2 + 1ε
Performing Operations
# Example: f(x) = log(sin(x)) + x^2 * cos(x)
f_x = log(sin(x)) + x**2 * cos(x)
print(f_x) # Output the result and its 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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rsr45_dual_autodiff_x-0.1.5.tar.gz.
File metadata
- Download URL: rsr45_dual_autodiff_x-0.1.5.tar.gz
- Upload date:
- Size: 239.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9477dc4c3a973c5a5367e43730633e5d470075d45b4704f8d1fee921ebfc29c0
|
|
| MD5 |
40ac832b65a209e382bb3a98fb03ba79
|
|
| BLAKE2b-256 |
85024be351af673c954111e0d779fc7d7192ec99f6d897a615aa0597497d417d
|
File details
Details for the file rsr45_dual_autodiff_x-0.1.5-cp312-cp312-macosx_10_15_x86_64.whl.
File metadata
- Download URL: rsr45_dual_autodiff_x-0.1.5-cp312-cp312-macosx_10_15_x86_64.whl
- Upload date:
- Size: 313.2 kB
- Tags: CPython 3.12, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f8b237d8f8f1b153eb72b1d0fbc53c5c162dd1816901a695b2d09fa4a7e464
|
|
| MD5 |
52577b2e64305b2861aa1db2c1393642
|
|
| BLAKE2b-256 |
e4d697f40c451a0f7ac2ba2020890406d8e686ef9808a47fd2ba7865e1195ff4
|