MCPcopy Create free account
hub / github.com/FastLED/FastLED / sin_poly_quarterturn_

Function sin_poly_quarterturn_

src/fl/math/math.cpp.hpp:170–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168// Max error ~1e-5 for float, ~1e-10 for double on the reduced range.
169template <typename F>
170inline F sin_poly_quarterturn_(F x) FL_NOEXCEPT {
171 // sin(x) ≈ x - x³/6 + x⁵/120 - x⁷/5040
172 const F x2 = x * x;
173 return x * (F(1) - x2 * (F(1.0 / 6.0) - x2 * (F(1.0 / 120.0) - x2 * F(1.0 / 5040.0))));
174}
175
176template <typename F>
177inline F cos_poly_quarterturn_(F x) FL_NOEXCEPT {

Callers 1

sin_reduce_Function · 0.85

Calls 1

FClass · 0.85

Tested by

no test coverage detected