A question about an approximation on exponential function in LAMMPS

Hi, LAMMPS users.

I have a question about an approximation on exponential function in LAMMPS.

For example, there is a IF-sentence in tersoff.cpp like below:

if (tmp > 69.0776) ex_delr = 1.e30;

else if (tmp < -69.0776) ex_delr = 0.0;

else ex_delr = exp(tmp);

I just want to know that such kind of approximation is simply for better performance regarding simulation speed or any other reasons.

Please enlighten me if there are things considered except the performance matter.

Thank you.

Jo.

Hi, LAMMPS users.

I have a question about an approximation on exponential function in LAMMPS.

For example, there is a IF-sentence in tersoff.cpp like below:

if (tmp > 69.0776) ex_delr = 1.e30;

else if (tmp < -69.0776) ex_delr = 0.0;

else ex_delr = exp(tmp);

I just want to know that such kind of approximation is simply for better performance regarding simulation speed or any other reasons.

other reasons. it is to avoid spurious out-of-range issues causing NaN or floating point exceptions on certain (non-x86) platforms.
especially, overflows through NaNs may happen by cascade simulations.

axel.