Commit d95e95abfb5eaf9807d72dfff3f836458f70f328

Authored by Jordi Inglada
1 parent e887751c

BUG: correction for precision overflow in diff_sigmo

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/Library/phenoFunctions.txx
... ... @@ -153,8 +153,8 @@ template <typename T>
153 153 inline
154 154 T diff_sigmoid(T t, T x0, T x1)
155 155 {
156   - auto a = (1+exp((x0-t)/x1))*(1+exp((x0-t)/x1));
157   - return exp((x0-t)/x1)/(x1*a);
  156 + auto b = exp((x0-t)/x1);
  157 + return 1.0/(x1*(1+1/b)*(1+b));
158 158 }
159 159  
160 160 template <typename T, ContainerC V>
... ...