float exp_decay (float T_const, float t) { // the argument might not make mathematical sense (whatever.) assert(!isnan(T_const)); assert(!isnan(t)); if (T_const <= 0.001) { return 0.0; } else { float r = exp(- t / T_const); assert(!isnan(r)); return r; } }