Gamma power speed up
"Fix" to #185 (closed). See also the discussion in #166 (closed).
Two improvements:
- Speed-up the calculation of x^\gamma, x^{\gamma-1} and x^-(\gamma-1) . Currently support \gamma=5/3, \gamma=4/3 and \gamma=2.
- Write the details of the hydro scheme in the snapshots.
Branch can be removed.
Merge request reports
Activity
Added 1 commit:
- 846c5ac6 - Correct header guards
mentioned in issue #166 (closed)
Added 1 commit:
- 8ba27aa3 - Missed one file in the commit
Added 1 commit:
- c3e24e72 - Do the same for pow(x, gamma-1)
LGTM, handing off to @pdraper.
Reassigned to @pdraper
Added 1 commit:
- fa2b946e - Fix documentation syntax, enable MATHJAX
mentioned in commit 489556aa
mentioned in issue #185 (closed)
@nnrw56, it actually leads to a nasty overflow in some situations where x^5 is huge but x^5/3 is reasonable.
I have replaced it with a safer version:
__attribute__((always_inline)) INLINE static float pow_gamma(float x) { #if defined(HYDRO_GAMMA_5_3) const float cbrt = cbrtf(x); /* x^(1/3) */ return cbrt * cbrt * x; /* x^(5/3) */ #else //... }
Please register or sign in to reply