pub fn gradient(J: &MatrixF64, f: &VectorF64, g: &mut VectorF64) -> Value