function llogz = plog(z,eps,d)
%% Pseudo logarithm
%
% The pseudo logarithm agrees with log for arguments larger
% than eps. Below eps it is a quadratic. It has two continuous
% derivatives.
%
% Input
%
% z = matrix of pseudolog arguments
% eps = threshold
% d = 0,1,2, for function, 1st, 2nd deriv
%
%
if nargin < 3
d = 0;
end
zsize = size(z);
out = z(:);
low = out