MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / sign

Function sign

encoder/cppspmd_sse.h:1526–1526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1524CPPSPMD_FORCE_INLINE vfloat frac(const vfloat& a) { return a - floor(a); }
1525CPPSPMD_FORCE_INLINE vfloat fmod(vfloat a, vfloat b) { vfloat c = frac(abs(a / b)) * abs(b); return spmd_ternaryf(a < 0, -c, c); }
1526CPPSPMD_FORCE_INLINE vfloat sign(const vfloat& a) { return spmd_ternaryf(a < 0.0f, 1.0f, 1.0f); }
1527
1528CPPSPMD_FORCE_INLINE vint max(const vint& a, const vint& b) { return vint{ max_epi32(a.m_value, b.m_value) }; }
1529CPPSPMD_FORCE_INLINE vint min(const vint& a, const vint& b) { return vint{ min_epi32(a.m_value, b.m_value) }; }

Callers 1

recip_est1_pnMethod · 0.70

Calls 1

spmd_ternaryfFunction · 0.85

Tested by

no test coverage detected