compute phase properly for negative clock