Changed to using correct versions of expf and caching the result; unsure if this is correct still, though