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

Function measure_asin

tests/fl/math/fixed_point.cpp:1471–1488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1469}
1470
1471AccuracyResult measure_asin() {
1472 AccuracyResult r = {};
1473 const int N = 10; // Spot testing: 10 key points adequate for [-0.999, 0.999] range (was 50)
1474 const float lo = -0.999f;
1475 const float hi = 0.999f;
1476 float sumErr = 0;
1477 for (int i = 0; i < N; ++i) {
1478 float x = lo + (hi - lo) * i / (N - 1);
1479 float ref = fl::asinf(x);
1480 float got = s16x16::asin(s16x16(x)).to_float();
1481 float err = fl::fabsf(got - ref);
1482 sumErr += err;
1483 if (err > r.maxErr) { r.maxErr = err; r.worstInput = x; }
1484 }
1485 r.avgErr = sumErr / N;
1486 r.nSamples = N;
1487 return r;
1488}
1489
1490AccuracyResult measure_acos() {
1491 AccuracyResult r = {};

Callers 1

FL_TEST_FILEFunction · 0.85

Calls 5

asinfFunction · 0.85
asinFunction · 0.85
fabsfFunction · 0.85
s16x16Class · 0.50
to_floatMethod · 0.45

Tested by

no test coverage detected