Added isDensifying to DoubleFunction and fixed swap for Times.