Avoids dividing by zero or very small values.
| 34 | |
| 35 | // Avoids dividing by zero or very small values. |
| 36 | CPPSPMD_FORCE_INLINE vfloat safe_div(vfloat a, vfloat b, float fDivThresh = 1e-7f) |
| 37 | { |
| 38 | return a / spmd_ternaryf( abs(b) > fDivThresh, b, spmd_ternaryf(b < 0.0f, -fDivThresh, fDivThresh) ); |
| 39 | } |
| 40 | |
| 41 | /* |
| 42 | clang 9.0.0 for win /fp:precise release |
nothing calls this directly
no test coverage detected