Skip to content
Snippets Groups Projects
Commit 3f041add authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Do not use eps=0 in the gravity derivative unit test. That leads to FPEs when...

Do not use eps=0 in the gravity derivative unit test. That leads to FPEs when running without optimizations.
parent 99e8c82a
Branches
Tags
1 merge request!421No shadowed variables
......@@ -952,10 +952,13 @@ int main() {
/* Compute distance */
const double r2 = dx * dx + dy * dy + dz * dz;
const double r_inv = 1. / sqrt(r2);
const double r = r2 * r_inv;
const double eps = r / 10.;
const double eps_inv = 1. / eps;
/* Compute all derivatives */
struct potential_derivatives_M2L pot;
compute_potential_derivatives_M2L(dx, dy, dz, r2, r_inv, 0., FLT_MAX, &pot);
compute_potential_derivatives_M2L(dx, dy, dz, r2, r_inv, eps, eps_inv, &pot);
/* Minimal value we care about */
const double min = 1e-9;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment