| 458 | */ |
| 459 | |
| 460 | CPPSPMD_FORCE_INLINE vfloat spmd_kernel::tan82(vfloat x) |
| 461 | { |
| 462 | // Original double version was 8.2 digits |
| 463 | //double c1 = 211.849369664121f, c2 = -12.5288887278448f, c3 = 269.7350131214121f, c4 = -71.4145309347748f; |
| 464 | // Tuned float constants for lower avg rel error (without using FMA3): |
| 465 | const float c1 = 211.849350f, c2 = -12.5288887f, c3 = 269.734985f, c4 = -71.4145203f; |
| 466 | vfloat x2 = x * x; |
| 467 | return (x * (vfma(c2, x2, c1)) / (vfma(x2, (c4 + x2), c3))); |
| 468 | } |
| 469 | |
| 470 | // Don't call this for angles close to 90/270!. |
| 471 | inline vfloat spmd_kernel::tan_est(vfloat x) |