keyword">else</span>
    [M, S, C, dMdm, dSdm, dCdm, dMds, dSds, dCds, dMdp, dSdp] = policy.fcn(policy, m, s);
    df = dSdp;
<span class="keyword">end</span>
f = S;

<span class="keyword">function</span> [f, df] = conT8(p, policy, m, s)
policy.p = p;
<span class="keyword">if</span> nargout &lt; 2
    [M, S, C] = policy.fcn(policy, m, s);
<span class="keyword">else</span>
    [M, S, C, dMdm, dSdm, dCdm, dMds, dSds, dCds, dMdp, dSdp, dCdp] = <span class="keyword">...</span>
                                  