MCPcopy Create free account
hub / github.com/defold/defold / fmod_inv

Function fmod_inv

engine/dlib/src/basis/encoder/cppspmd_math.h:24–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22// I compared each to the ones in DirectXMath and stdlib's for accuracy/performance.
23
24CPPSPMD_FORCE_INLINE vfloat fmod_inv(const vfloat& a, const vfloat& b, const vfloat& b_inv)
25{
26 vfloat c = frac(abs(a * b_inv)) * abs(b);
27 return spmd_ternaryf(a < 0, -c, c);
28}
29
30CPPSPMD_FORCE_INLINE vfloat fmod_inv_p(const vfloat& a, const vfloat& b, const vfloat& b_inv)
31{

Callers

nothing calls this directly

Calls 3

fracFunction · 0.85
absFunction · 0.85
spmd_ternaryfFunction · 0.85

Tested by

no test coverage detected