package com.kofax.mobile.sdk.k; import java.util.ArrayDeque; import java.util.Iterator; /* loaded from: classes3.dex */ public class k { private static final int GB = 5; private static final int GC = 2; private static final int GD = 10; private final ArrayDeque GE = new ArrayDeque<>(10); private int stability = 0; private int GF = 0; private int GG = 5; private boolean GH = false; public void l(int i, int i2) { while (this.GE.size() > 9) { this.GE.removeFirst(); } this.GE.addLast(Double.valueOf(i2)); int lv = lv(); this.stability = lv; int m = m(lv); this.GF = m; boolean z = this.stability > i || m < 100 - i; boolean z2 = this.GH; if (z == z2) { this.GG = z2 ? 2 : 5; return; } int i3 = this.GG - 1; this.GG = i3; if (i3 == 0) { this.GH = z; this.GG = z ? 2 : 5; } } private int lv() { if (this.GE.size() == 0) { return 0; } Iterator it = this.GE.iterator(); double d = 0.0d; while (it.hasNext()) { d += it.next().doubleValue(); } return (int) (d / this.GE.size()); } private int m(int i) { if (this.GE.size() == 0) { return 0; } Iterator it = this.GE.iterator(); double d = 0.0d; while (it.hasNext()) { Double next = it.next(); double d2 = i; d += (next.doubleValue() - d2) * (next.doubleValue() - d2); } return (int) Math.sqrt(d / this.GE.size()); } public int lx() { return this.GF; } public int lw() { return this.stability; } public boolean kJ() { return this.GH; } }