def METHOD_NAME(x, return_hessian=False):
    f = 0.5 * dot(x * p['H'], x) + dot(p['c'], x)
    df = p['H'] * x + p['c']
    if not return_hessian:
        return f, df
    d2f = p['H']
    return f, df, d2f