MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / RelativeError

Function RelativeError

tests/common/test_helpers.hpp:31–36  ·  view source on GitHub ↗

Calculate relative error

Source from the content-addressed store, hash-verified

29
30// Calculate relative error
31inline float RelativeError(float actual, float expected) {
32 if (std::abs(expected) < 1e-10f) {
33 return std::abs(actual - expected);
34 }
35 return std::abs((actual - expected) / expected);
36}
37
38// Calculate mean squared error
39inline float MeanSquaredError(const float* a, const float* b, size_t size) {

Callers

nothing calls this directly

Calls 1

absFunction · 0.50

Tested by

no test coverage detected