## Calculate the Tanimoto similarity between two vectors

function tm = tanimoto (x,y)

   nx = sum (x.^2);
   ny = sum (y.^2);
   pxy = x' * y;

   tm = pxy / (nx + ny - pxy);
endfunction

