
%%%%%%%%

function [g,h,K] = mk_var_approx(w, b, t, xi)

assert(t==0 | t==1);
s = logistic(xi);
lambda = (0.5 - s) / (2*xi);
g = log(s) + 0.5*(2*t-1)*b - 0.5*xi + lambda*(b^2 - xi^2);
h = 0.5*(2*t-1)*w + lambda*2*b*w;
K = -2*lambda*w*w';
