function gamma calculator