static double smoothedMovingAverage(double period, double... a) { int n = l(a); if (n == 0) ret Double.NaN; double alpha = reciprocal(period); double value = first(a); for (int i = 1; i < n; i++) value = blend(value, a[i], alpha); ret value; }