We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4f6bb1 commit 95e6308Copy full SHA for 95e6308
1 file changed
src/gravity/octree.h
@@ -2,7 +2,6 @@
2
#include "../struct/particle.h"
3
#include <vector>
4
5
-
6
// =========================
7
// Octree definition
8
@@ -90,6 +89,12 @@ struct Octree {
90
89
}
91
};
92
+inline float rsqrt(float x) {
93
+ float y = _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x)));
94
+ // optional refinement:
95
+ return y * (1.5f - 0.5f * x * y * y);
96
+}
97
+
98
99
// Barnes–Hut force function
100
0 commit comments