package d3;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.util.Arrays;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.t;

/* loaded from: classes.dex */
public final class c implements d3.a {

    /* renamed from: c, reason: collision with root package name */
    public static final a f15907c = new a(null);

    /* renamed from: d, reason: collision with root package name */
    public static final int f15908d = 8;

    /* renamed from: a, reason: collision with root package name */
    private final float[] f15909a;

    /* renamed from: b, reason: collision with root package name */
    private final float[] f15910b;

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(k kVar) {
            this();
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final float b(float f10, float[] fArr, float[] fArr2) {
            float f11;
            float f12;
            float f13;
            float f14;
            float a10;
            float abs = Math.abs(f10);
            float signum = Math.signum(f10);
            int binarySearch = Arrays.binarySearch(fArr, abs);
            if (binarySearch >= 0) {
                a10 = fArr2[binarySearch];
            } else {
                int i10 = (-(binarySearch + 1)) - 1;
                if (i10 >= fArr.length - 1) {
                    float f15 = fArr[fArr.length - 1];
                    return f15 == BitmapDescriptorFactory.HUE_RED ? BitmapDescriptorFactory.HUE_RED : f10 * (fArr2[fArr.length - 1] / f15);
                }
                if (i10 == -1) {
                    float f16 = fArr[0];
                    f13 = fArr2[0];
                    f14 = 0.0f;
                    f11 = 0.0f;
                    f12 = f16;
                } else {
                    float f17 = fArr[i10];
                    int i11 = i10 + 1;
                    float f18 = fArr[i11];
                    float f19 = fArr2[i10];
                    f11 = f17;
                    f12 = f18;
                    f13 = fArr2[i11];
                    f14 = f19;
                }
                a10 = d.f15911a.a(f14, f13, f11, f12, abs);
            }
            return signum * a10;
        }
    }

    public c(float[] fArr, float[] fArr2) {
        boolean z10 = false;
        if (fArr.length == fArr2.length) {
            if (!(fArr.length == 0)) {
                z10 = true;
            }
        }
        if (!z10) {
            throw new IllegalArgumentException("Array lengths must match and be nonzero".toString());
        }
        this.f15909a = fArr;
        this.f15910b = fArr2;
    }

    @Override // d3.a
    public float a(float f10) {
        return f15907c.b(f10, this.f15910b, this.f15909a);
    }

    @Override // d3.a
    public float b(float f10) {
        return f15907c.b(f10, this.f15909a, this.f15910b);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || !(obj instanceof c)) {
            return false;
        }
        c cVar = (c) obj;
        return Arrays.equals(this.f15909a, cVar.f15909a) && Arrays.equals(this.f15910b, cVar.f15910b);
    }

    public int hashCode() {
        return (Arrays.hashCode(this.f15909a) * 31) + Arrays.hashCode(this.f15910b);
    }

    public String toString() {
        StringBuilder sb2 = new StringBuilder();
        sb2.append("FontScaleConverter{fromSpValues=");
        String arrays = Arrays.toString(this.f15909a);
        t.f(arrays, "toString(this)");
        sb2.append(arrays);
        sb2.append(", toDpValues=");
        String arrays2 = Arrays.toString(this.f15910b);
        t.f(arrays2, "toString(this)");
        sb2.append(arrays2);
        sb2.append('}');
        return sb2.toString();
    }
}
