MCPcopy Create free account
hub / github.com/apache/trafficserver / standard_deviation

Function standard_deviation

lib/catch2/catch.hpp:7738–7745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7736 }
7737
7738 double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
7739 auto m = Catch::Benchmark::Detail::mean(first, last);
7740 double variance = std::accumulate(first, last, 0., [m](double a, double b) {
7741 double diff = b - m;
7742 return a + diff * diff;
7743 }) / (last - first);
7744 return std::sqrt(variance);
7745 }
7746
7747}
7748

Callers

nothing calls this directly

Calls 1

meanFunction · 0.85

Tested by

no test coverage detected