| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-03-15 | 1.9 kB | |
| v0.41.0 source code.tar.gz | 2026-03-15 | 4.4 MB | |
| v0.41.0 source code.zip | 2026-03-15 | 4.5 MB | |
| Totals: 3 Items | 8.8 MB | 1 | |
Release 0.41.0 (2026-03-15)
Replace enum AD with const-generic Jet<N> (Breaking Change)
Core
- Replace
enum AD { AD0(f64), AD1(f64,f64), AD2(f64,f64,f64) }withstruct Jet<const N: usize> - Normalized Taylor coefficients — all arithmetic uses simple convolution (no binomial coefficients)
- Arbitrary-order forward AD:
Jet<1>,Jet<2>, ...,Jet<10>, etc. - Type aliases:
Dual = Jet<1>,HyperDual = Jet<2> - Direct
sqrtrecurrence (instead ofpowf(0.5))
Proc Macro (peroxide-ad)
#[ad_function]now generatesf_ad<const JET_ORDER: usize>(x: Jet<JET_ORDER>) -> Jet<JET_ORDER>— arbitrary-order differentiationad_closure!generatesJet<1>closure
Backward Compatibility
ADtype alias (= Jet<2>),AD0,AD1,AD2constructor functions preservedADFn,ADVec,StableFnimpls preservedRealtrait implemented forJet<2>(viaADalias)
Integration Updates
jacobian(),newton(),Optimizerupdated to useJet<1>internallynewton!macro works with new proc macro output
Documentation
- KaTeX-rendered math in all doc comments (recurrences for exp, ln, sin/cos, sqrt, inverse trig)
- Accuracy plot:
Jet<N>vs finite differences - Taylor convergence plot:
sin(x)polynomial approximation - New examples:
jet_ad.rs,higher_order_ad.rs - Updated examples:
hessian.rs,real_trait_test.rs - 115 new Jet-specific unit tests
Migration Guide
| Old (0.40.x) | New (0.41.0) |
|---|---|
AD1(x, dx) |
AD1(x, dx) (still works) or Jet::<1>::var(x) |
AD2(x, dx, ddx) |
AD2(x, dx, ddx) (still works) or Jet::<2>::var(x) |
fn f(x: AD) -> AD |
fn f(x: AD) -> AD (still works) or fn f(x: Jet<2>) -> Jet<2> |
f_ad(x: AD) (macro) |
f_ad::<N>(x: Jet<N>) (now generic) |
Fn(&Vec<AD>) -> Vec<AD> |
Fn(&Vec<AD>) -> Vec<AD> (still works) |