diff --git a/MotionMark/resources/statistics.js b/MotionMark/resources/statistics.js index 30fa89d..9139599 100644 --- a/MotionMark/resources/statistics.js +++ b/MotionMark/resources/statistics.js @@ -244,11 +244,11 @@ Regression = Utilities.createClass( }, _areEssentiallyEqual: function(n1, n2) { - const epsilon = 0.001; + const epsilon = 0.0001; return Math.abs(n1 - n2) < epsilon; }, - _setOptimal: function(segment1, segment2, xp, x, options) { + _setOptimal: function(segment1, segment2, x, xn, options) { if (segment1.e + segment2.e > this.segment1.e + this.segment2.e) return false; @@ -256,7 +256,7 @@ Regression = Utilities.createClass( if (!this._areEssentiallyEqual(this.segment1.t, this.segment2.t)) { // If segment1 and segment2 are not parallel, then they have to meet // at complexity such that xp < complexity < x. - if (!(complexity >= xp && complexity <= x)) + if (!(complexity >= x && complexity <= xn)) return false; } else { // If segment1 and segment2 are parallel, then they have to form one @@ -395,7 +395,7 @@ Regression = Utilities.createClass( }; } - if (this._setOptimal(segment1, segment2, xp, x, options)) + if (this._setOptimal(segment1, segment2, x, sortedSamples[j + 1][complexityIndex], options)) continue // These values remove the influence of this sample @@ -426,7 +426,7 @@ Regression = Utilities.createClass( e: (k2 + a2 * s2 * s2 + c2 * t2 * t2 - 2 * d2 * s2 - 2 * h2 * t2 + 2 * b2 * s2 * t2) + lambda1 * Math.pow(y - (s2 + t2 * x), 2) }; - this._setOptimal(segment1, segment2, xp, x, options); + this._setOptimal(segment1, segment2, x, sortedSamples[j + 1][complexityIndex], options); } } });