Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsr45_dual_autodiff_x-0.1.6.tar.gz (239.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rsr45_dual_autodiff_x-0.1.6-cp312-cp312-macosx_10_15_x86_64.whl (313.2 kB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

File details

Details for the file rsr45_dual_autodiff_x-0.1.6.tar.gz.

File metadata

  • Download URL: rsr45_dual_autodiff_x-0.1.6.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

Hashes for rsr45_dual_autodiff_x-0.1.6.tar.gz
Algorithm Hash digest
SHA256 57cd4d14e5f6d7c5a47d3aacf4643c66443adfac687c029d4eca87caf5d08794
MD5 0357b76c0fd483ce33b6c43d132c6c7d
BLAKE2b-256 a54f29a03e73e31fd2d29cba70c86de60a4b186a54fbc470bf08fe4d0c3df8a9

See more details on using hashes here.

File details

Details for the file rsr45_dual_autodiff_x-0.1.6-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for rsr45_dual_autodiff_x-0.1.6-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 701c24c83087224d912c4a56b64dc58d923d0dbc566bf12fdeb1cdd3c1c74135
MD5 098f77ff29831bf9db9318502bc95fde
BLAKE2b-256 7772ee142794577e41fe04441565c8fc6556ced9b53f39a5c21736009445b4c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page