Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
ed3a32d3
Commit
ed3a32d3
authored
May 05, 2020
by
Matthieu Schaller
Browse files
Do not use the approximate erf in the long-range truncation functions
parent
4f82cd78
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kernel_long_gravity.h
View file @
ed3a32d3
...
...
@@ -91,7 +91,7 @@ kernel_long_grav_derivatives(const float r, const float r_s_inv,
const
float
r_s_inv5
=
r_s_inv4
*
r_s_inv
;
/* Derivatives of \chi */
derivs
->
chi_0
=
approx_
erfcf
(
u
);
derivs
->
chi_0
=
erfcf
(
u
);
derivs
->
chi_1
=
-
r_s_inv
;
derivs
->
chi_2
=
r_s_inv2
*
u
;
derivs
->
chi_3
=
-
r_s_inv3
*
(
u2
-
0
.
5
f
);
...
...
@@ -158,7 +158,7 @@ __attribute__((const)) INLINE static float kernel_long_grav_pot_eval(
#ifdef GADGET2_LONG_RANGE_CORRECTION
const
float
arg1
=
u
*
0
.
5
f
;
return
approx_
erfcf
(
arg1
);
return
erfcf
(
arg1
);
#else
...
...
@@ -190,7 +190,7 @@ __attribute__((const)) INLINE static float kernel_long_grav_force_eval(
const
float
arg1
=
u
*
0
.
5
f
;
const
float
arg2
=
-
arg1
*
arg1
;
const
float
term1
=
approx_
erfcf
(
arg1
);
const
float
term1
=
erfcf
(
arg1
);
const
float
term2
=
u
*
one_over_sqrt_pi
*
expf
(
arg2
);
return
term1
+
term2
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment