#include <oxstd.h>

fRosenbrock(const vP, const adFunc, const avScore,
    const amHess)
{
    adFunc[0] = -100 * (vP[1] - vP[0] .^ 2) .^ 2
        - (1 - vP[0]) .^ 2;              // function value

return 1;                           // 1 indicates success
}

main()
{
    decl vp, dfunc, ir;

    vp = zeros(2, 1);                   // starting values
    ir = fRosenbrock(vp, &dfunc, 0, 0);        // evaluate

    print("function value is ", dfunc, 
        "\n at parameter value:", vp');
}
