* This is too brittle and might clash with MSVC's M_PI. See [1].
* We only used it once (in a unit test).
* We shouldn't use PI anyway [2].
Instead, pull it from <cmath> with _USE_MATH_DEFINES,
like it's already done in the code base.
[1] https://ci.chromium.org/p/webrtc/builders/try/win_x86_msvc_rel/6844
[2] https://tauday.com/tau-manifesto
Bug: webrtc:9855
Change-Id: I7a6976240604ef367ea07478d8cb5e4020e5dfeb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132548
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#27597}
This CL implements Welford's algorithm for a
numerically stable computation of the variance.
This implementation is plugged in SamplesStatsCounter class (adapter pattern).
A 'NumericalStability' unit test has been added,
whose previous implementation of SamplesStatsCounter failed to pass.
Follow-up CLs will factorize more occurences of duplicated and misbehaved
computations.
Bug: webrtc:10412
Change-Id: Id807c3d34e9c780fb1cbd769d30b655c575c88ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131394
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27547}