% Catch divide-by-zeros. If denom is effectively zero, set it to
% something tiny instead. This trick is also used in the PCGM.
denom = sign(denom)*eps;
% Catch divide-by-zeros. If denom is effectively zero, set it to
% something tiny instead. This trick is also used in the PCGM.
denom = sign(denom)*eps;