Principle:1kbgz Tributary Automatic Differentiation
| Knowledge Sources | |
|---|---|
| Domains | Automatic_Differentiation, Mathematical_Operators |
| Last Updated | 2026-10-14 00:00 GMT |
Overview
A technique for computing exact derivatives of functions by augmenting each arithmetic operation with a derivative computation, using dual numbers to carry both the function value and its derivative through the computation graph.
Description
Forward-mode automatic differentiation (AD) computes derivatives by propagating tangent values alongside primal values through a computation. The dual number extension represents values as where is the function value and is the derivative with respect to a chosen input.
Each arithmetic operation is augmented with its derivative rule:
- Addition:
- Multiplication: (product rule)
- Power:
- Sine:
- Cosine:
This solves the problem of numerical differentiation, which is inaccurate (finite differences) or infeasible (symbolic differentiation explodes for complex expressions). Forward-mode AD gives exact derivatives in O(1)x the cost of the original computation.
Usage
Use this principle when you need exact derivatives of mathematical functions expressed as computation graphs:
- Gradient-based optimization (sensitivity analysis)
- Physics simulations requiring Jacobians
- Financial risk calculations (Greeks)
- Verifying analytical derivatives against numerical tests
In Tributary, enable by setting use_dual=True on input nodes; all downstream operators automatically select their dual-number lambda variants.
Theoretical Basis
Dual numbers extend real numbers with an infinitesimal element where :
A function evaluated at gives:
This is Taylor expansion truncated at first order, justified because .
The chain rule is automatically satisfied through composition:
# Abstract dual-number arithmetic (NOT real implementation)
class Dual:
def __init__(self, value, derivative):
self.v = value # primal (function value)
self.d = derivative # tangent (derivative)
def __mul__(self, other):
return Dual(
self.v * other.v,
self.v * other.d + self.d * other.v # product rule
)
def __add__(self, other):
return Dual(
self.v + other.v,
self.d + other.d
)
To compute : set the input seed (i.e., ) and read the derivative from .
Related Pages
Implemented By
- Implementation:1kbgz_Tributary_Lazy_Node
- Implementation:1kbgz_Tributary_Lazy_Operators
- Implementation:1kbgz_Tributary_Streaming_Node
- Implementation:1kbgz_Tributary_Streaming_Operators