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

Function test_ad2_constructor_normalization

tests/jet_tests.rs:83–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82#[test]
83fn test_ad2_constructor_normalization() {
84 // ad2(x, dx, ddx) stores ddx/2 internally; ddx() returns deriv[1]*2 = ddx
85 let j = ad2(4.0, 4.0, 2.0);
86 assert_close(j.value(), 4.0);
87 assert_close(j.dx(), 4.0);
88 // Normalized convention: ddx() == raw second derivative == 2.0
89 assert_close(j.ddx(), 2.0);
90}
91
92#[test]
93fn test_ad2_internal_storage() {

Callers

nothing calls this directly

Calls 5

ad2Function · 0.85
dxMethod · 0.80
ddxMethod · 0.80
assert_closeFunction · 0.70
valueMethod · 0.45

Tested by

no test coverage detected