15 double timeMax =
std::log((1.0 -
std::exp(tauLin/tauRise))/(1.0 -
std::exp(tauLin/tauFall)))/(1./tauRise-1./tauFall);
16 double timeAdj =
time + timeMax;
18 if (timeAdj < 0)
return 0;
20 double term1 = (tauFall*(1.0 -
std::exp(-timeAdj/tauFall)) - tauRise*(1.0 -
std::exp(-timeAdj/tauRise)));
23 if (timeAdj > tauLin) term2 = (-tauFall*(1.0 -
std::exp(-(timeAdj-tauLin)/tauFall)) +
24 tauRise*(1.0 -
std::exp(-(timeAdj-tauLin)/tauRise)));
26 return tauRise/tauLin*(term1 + term2)/ (tauFall-tauRise);