%-----------

function out = ptanh( x) % save as ptanh.m
%       Just like tanh but way faster

out = 1 - 2 ./ (exp( 2*x) + 1);

