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

Method tan82

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

Source from the content-addressed store, hash-verified

458*/
459
460CPPSPMD_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!.
471inline vfloat spmd_kernel::tan_est(vfloat x)

Callers

nothing calls this directly

Calls 1

vfmaFunction · 0.85

Tested by

no test coverage detected