Skip to main content

mixed_partial

Function mixed_partial 

Source
pub fn mixed_partial<F: Float + TaylorArenaLocal>(
    tape: &BytecodeTape<F>,
    x: &[F],
    orders: &[u8],
) -> (F, F)
Available on crate feature diffop only.
Expand description

Compute a single mixed partial derivative (plans + evaluates in one call).

Returns (value, derivative) where value = u(x) and derivative is the mixed partial specified by orders.

When every order in orders is zero, the function returns (u(x), u(x)) — an all-zero multi-index is the identity operator, so the “derivative” is just u(x) itself. This is the mathematically correct answer and not an error. An earlier version of this docstring claimed a panic; no such panic exists.

§Panics

Panics if orders.len() does not match tape.num_inputs().