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.3.tar.gz (239.4 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.3-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.3.tar.gz.

File metadata

  • Download URL: rsr45_dual_autodiff_x-0.1.3.tar.gz
  • Upload date:
  • Size: 239.4 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.3.tar.gz
Algorithm Hash digest
SHA256 17243a1851c4003107c651b0930f3ac1e2fc5de35d913ac7f9db6697aad0073d
MD5 144e0e23a90efb8c2b3b51df19237b9a
BLAKE2b-256 2cad71b0d2d0a2c3705fdbbcf57e7f7a1cfd30441fddc928cb21c75b4f582f37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rsr45_dual_autodiff_x-0.1.3-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8500218ecc745fcfc054a8dcefc7bcece06cd5d26695a783d558a14645d37def
MD5 0477d0212c71e4eda7cb635ec969b68d
BLAKE2b-256 3a1afdb63701bf30fb95dac025701f262371e674570a58fa583e8af91323c2f5

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