positive values only
| 339 | |
| 340 | // positive values only |
| 341 | CPPSPMD_FORCE_INLINE vfloat spmd_kernel::recip_est1(const vfloat& q) |
| 342 | { |
| 343 | //const int mag = 0x7EF312AC; // 2 NR iters, 3 is 0x7EEEEBB3 |
| 344 | const int mag = 0x7EF311C3; |
| 345 | const float fMinThresh = .0000125f; |
| 346 | |
| 347 | vfloat l = spmd_ternaryf(q >= fMinThresh, q, cast_vint_to_vfloat(vint(mag))); |
| 348 | |
| 349 | vint x_l = vint(mag) - cast_vfloat_to_vint(l); |
| 350 | |
| 351 | vfloat rcp_l = cast_vint_to_vfloat(x_l); |
| 352 | |
| 353 | return rcp_l * vfnma(rcp_l, q, 2.0f); |
| 354 | } |
| 355 | |
| 356 | CPPSPMD_FORCE_INLINE vfloat spmd_kernel::recip_est1_pn(const vfloat& t) |
| 357 | { |
nothing calls this directly
no test coverage detected