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.4.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.4-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.4.tar.gz.

File metadata

  • Download URL: rsr45_dual_autodiff_x-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8962a4cd43ee3d60582540746a651625fce6a1b9393e0b0c961ecd20886e5c42
MD5 a165509a53491884509b89ae1d178714
BLAKE2b-256 597a78439a8b431c533062937a98623e2adb2b1ef0a1237e78de67ab12c3a044

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rsr45_dual_autodiff_x-0.1.4-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 04758e15a0b7370fe767ca6756a5a105297f78367b29663862e16b289567eb2d
MD5 14546569d03e2a4083d5b0bc4dc337e1
BLAKE2b-256 ae97b7856ae35db647da4d9d01492fecbba7aab547ea37ca3e85ea6a3f1bdefb

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