function val = sign2(x)
tmp = sign(x);
val = tmp + abs(tmp) - 1;
