Merge branch release-2016
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_kernels / simd_2xnn / nbnxn_kernel_simd_2xnn_inner.h
index a680aff199e26c6d0b045f20ed5d3444dd6868be..3dfc89b2ade33b763745af51d5c79accb7d4392e 100644 (file)
 #ifndef HALF_LJ
         cr2_S2        = lje_c2_S * selectByMask(rsq_S2, wco_vdw_S2);
 #endif
-        expmcr2_S0    = exp( -cr2_S0);
+        // Unsafe version of our exp() should be fine, since these arguments should never
+        // be smaller than -127 for any reasonable choice of cutoff or ewald coefficients.
+        expmcr2_S0    = exp<MathOptimization::Unsafe>( -cr2_S0);
 #ifndef HALF_LJ
-        expmcr2_S2    = exp( -cr2_S2);
+        expmcr2_S2    = exp<MathOptimization::Unsafe>( -cr2_S2);
 #endif
 
         /* 1 + cr2 + 1/2*cr2^2 */