Implement preliminary gamma computation and related tests