gibbsfunction