function score: fix cast in Gaussian decay function