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

Function measure_asin_t

tests/fl/math/fixed_point.cpp:1750–1767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1748
1749template <typename T>
1750AccuracyResult measure_asin_t() {
1751 AccuracyResult r = {};
1752 const int N = 10; // Spot testing: 10 key points adequate for [-1, 1] range (was 50)
1753 const float lo = -1.0f;
1754 const float hi = 1.0f;
1755 float sumErr = 0;
1756 for (int i = 0; i < N; ++i) {
1757 float x = lo + (hi - lo) * i / (N - 1);
1758 float ref = fl::asinf(x);
1759 float got = T::asin(T(x)).to_float();
1760 float err = fl::fabsf(got - ref);
1761 sumErr += err;
1762 if (err > r.maxErr) { r.maxErr = err; r.worstInput = x; }
1763 }
1764 r.avgErr = sumErr / N;
1765 r.nSamples = N;
1766 return r;
1767}
1768
1769template <typename T>
1770AccuracyResult measure_acos_t() {

Callers

nothing calls this directly

Calls 5

asinfFunction · 0.85
asinFunction · 0.85
TEnum · 0.85
fabsfFunction · 0.85
to_floatMethod · 0.45

Tested by

no test coverage detected