/*sexp safe exponential function */ #include "cddefines.h" #include "sexp.h" double sexp(double x) { double sexp_v; # ifdef DEBUG_FUN fputs( "<+>sexp()\n", debug_fp ); # endif /* NB - the 84 in the following must be kept parallel with the 84 in boltgn, * since level2 uses ContBoltz to see whether the rates will be significant. * If the numbers did not agree then this test would be flawed, resulting in * div by zero */ if( x < 84. ) { sexp_v = exp(-x); } else { sexp_v = 0.; } # ifdef DEBUG_FUN fputs( " <->sexp()\n", debug_fp ); # endif return( sexp_v ); }