package b0;

/* JADX INFO: renamed from: b0.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0528e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public double f9157a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public double f9158b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f9159c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public double f9160d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public double f9161e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public double f9162f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public double f9163g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public double f9164h;
    public double i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final C0526c f9165j;

    public C0528e() {
        this.f9157a = Math.sqrt(1500.0d);
        this.f9158b = 0.5d;
        this.f9159c = false;
        this.i = Double.MAX_VALUE;
        this.f9165j = new C0526c();
    }

    public final C0526c a(double d8, double d9, long j8) {
        double dSin;
        double dCos;
        if (!this.f9159c) {
            if (this.i == Double.MAX_VALUE) {
                throw new IllegalStateException("Error: Final position of the spring must be set before the animation starts");
            }
            double d10 = this.f9158b;
            if (d10 > 1.0d) {
                double d11 = this.f9157a;
                this.f9162f = (Math.sqrt((d10 * d10) - 1.0d) * d11) + ((-d10) * d11);
                double d12 = this.f9158b;
                double d13 = this.f9157a;
                this.f9163g = ((-d12) * d13) - (Math.sqrt((d12 * d12) - 1.0d) * d13);
            } else if (d10 >= 0.0d && d10 < 1.0d) {
                this.f9164h = Math.sqrt(1.0d - (d10 * d10)) * this.f9157a;
            }
            this.f9159c = true;
        }
        double d14 = j8 / 1000.0d;
        double d15 = d8 - this.i;
        double d16 = this.f9158b;
        if (d16 > 1.0d) {
            double d17 = this.f9163g;
            double d18 = ((d17 * d15) - d9) / (d17 - this.f9162f);
            double d19 = d15 - d18;
            dSin = (Math.pow(2.718281828459045d, this.f9162f * d14) * d18) + (Math.pow(2.718281828459045d, d17 * d14) * d19);
            double d20 = this.f9163g;
            double dPow = Math.pow(2.718281828459045d, d20 * d14) * d19 * d20;
            double d21 = this.f9162f;
            dCos = (Math.pow(2.718281828459045d, d21 * d14) * d18 * d21) + dPow;
        } else if (d16 == 1.0d) {
            double d22 = this.f9157a;
            double d23 = (d22 * d15) + d9;
            double d24 = (d23 * d14) + d15;
            double dPow2 = Math.pow(2.718281828459045d, (-d22) * d14) * d24;
            double dPow3 = Math.pow(2.718281828459045d, (-this.f9157a) * d14) * d24;
            double d25 = -this.f9157a;
            dCos = (Math.pow(2.718281828459045d, d25 * d14) * d23) + (dPow3 * d25);
            dSin = dPow2;
        } else {
            double d26 = 1.0d / this.f9164h;
            double d27 = this.f9157a;
            double d28 = ((d16 * d27 * d15) + d9) * d26;
            dSin = ((Math.sin(this.f9164h * d14) * d28) + (Math.cos(this.f9164h * d14) * d15)) * Math.pow(2.718281828459045d, (-d16) * d27 * d14);
            double d29 = this.f9157a;
            double d30 = this.f9158b;
            double d31 = (-d29) * dSin * d30;
            double dPow4 = Math.pow(2.718281828459045d, (-d30) * d29 * d14);
            double d32 = this.f9164h;
            double dSin2 = Math.sin(d32 * d14) * (-d32) * d15;
            double d33 = this.f9164h;
            dCos = (((Math.cos(d33 * d14) * d28 * d33) + dSin2) * dPow4) + d31;
        }
        float f3 = (float) (dSin + this.i);
        C0526c c0526c = this.f9165j;
        c0526c.f9138a = f3;
        c0526c.f9139b = (float) dCos;
        return c0526c;
    }

    public C0528e(float f3) {
        this.f9157a = Math.sqrt(1500.0d);
        this.f9158b = 0.5d;
        this.f9159c = false;
        this.f9165j = new C0526c();
        this.i = f3;
    }
}
