autodiff Documentation
English documentation for Luna-Flow/autodiff 0.2.0.
Overview
autodiff provides forward-mode automatic differentiation over Luna Flow algebraic and arithmetic structures.
The current release introduces dual numbers:
text
Dual[T] = value + tangent ε, ε² = 0This lets ordinary scalar functions written against Luna Flow arithmetic be evaluated together with their first derivative.
Current Surface
Dual[T]withvalueandtangent.- Constructors:
Dual::new,Dual::constant, andDual::variable. - Accessors:
Dual::valueandDual::tangent. - Ring-level algebraic instances where the base scalar supports them.
- Checked division and checked square root through
Luna-Flow/arithmetic. - Elementary lifts for
sqrt,exp,ln,sin,cos, andtan. - Forward helpers:
diffandvalue_and_diff. - Linear algebra helpers:
gradient,jacobian,value_and_gradient, andvalue_and_jacobianinautodiff/linalg. - Polynomial helpers: dual-number evaluation and derivative-at-a-point helpers in
autodiff/poly.
Documents
- Core API: core/api.md
- Tutorial: core/tutorial.md
- Design notes: core/design.md
- Ecosystem integration API: integration/api.md
- Ecosystem integration tutorial: integration/tutorial.md
- Ecosystem integration design: integration/design.md
- Documentation standard: doc_standard.md
Validation
Recommended checks:
bash
moon check
./run_test.sh
moon info