MCPcopy Create free account
hub / github.com/Axect/Peroxide / call_stable

Method call_stable

src/structure/ad.rs:1034–1041  ·  view source on GitHub ↗
(&self, target: f64)

Source from the content-addressed store, hash-verified

1032 type Output = f64;
1033
1034 fn call_stable(&self, target: f64) -> f64 {
1035 match self.grad_level {
1036 0 => (self.f)(Jet::<2>::constant(target)).value(),
1037 1 => (self.f)(Jet::<2>::new(target, [1.0, 0.0])).dx(),
1038 2 => (self.f)(Jet::<2>::new(target, [1.0, 0.0])).ddx(),
1039 _ => unreachable!("grad_level > 2 is not allowed"),
1040 }
1041 }
1042}
1043
1044/// Scalar version: F works with `Jet<2>`, target is `Jet<2>`.

Calls 5

dxMethod · 0.80
ddxMethod · 0.80
into_iterMethod · 0.80
iterMethod · 0.80
valueMethod · 0.45