Average Error: 6.7 → 1.5
Time: 13.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -3.3572243601805693 \cdot 10^{-45}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -0.0:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 3.6377079460646548 \cdot 10^{+283}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -3.3572243601805693 \cdot 10^{-45}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\

\mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -0.0:\\
\;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\

\mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 3.6377079460646548 \cdot 10^{+283}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r25472756 = x;
        double r25472757 = y;
        double r25472758 = r25472756 * r25472757;
        double r25472759 = z;
        double r25472760 = r25472759 * r25472757;
        double r25472761 = r25472758 - r25472760;
        double r25472762 = t;
        double r25472763 = r25472761 * r25472762;
        return r25472763;
}

double f(double x, double y, double z, double t) {
        double r25472764 = x;
        double r25472765 = y;
        double r25472766 = r25472764 * r25472765;
        double r25472767 = z;
        double r25472768 = r25472767 * r25472765;
        double r25472769 = r25472766 - r25472768;
        double r25472770 = t;
        double r25472771 = r25472769 * r25472770;
        double r25472772 = -3.3572243601805693e-45;
        bool r25472773 = r25472771 <= r25472772;
        double r25472774 = r25472764 - r25472767;
        double r25472775 = r25472770 * r25472765;
        double r25472776 = r25472774 * r25472775;
        double r25472777 = -0.0;
        bool r25472778 = r25472771 <= r25472777;
        double r25472779 = r25472774 * r25472770;
        double r25472780 = r25472779 * r25472765;
        double r25472781 = 3.6377079460646548e+283;
        bool r25472782 = r25472771 <= r25472781;
        double r25472783 = r25472782 ? r25472771 : r25472776;
        double r25472784 = r25472778 ? r25472780 : r25472783;
        double r25472785 = r25472773 ? r25472776 : r25472784;
        return r25472785;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.7
Target3.0
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886777 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (* (- (* x y) (* z y)) t) < -3.3572243601805693e-45 or 3.6377079460646548e+283 < (* (- (* x y) (* z y)) t)

    1. Initial program 15.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.1

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]

    if -3.3572243601805693e-45 < (* (- (* x y) (* z y)) t) < -0.0

    1. Initial program 4.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified9.9

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*2.5

      \[\leadsto \color{blue}{\left(\left(x - z\right) \cdot t\right) \cdot y}\]

    if -0.0 < (* (- (* x y) (* z y)) t) < 3.6377079460646548e+283

    1. Initial program 0.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -3.3572243601805693 \cdot 10^{-45}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -0.0:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 3.6377079460646548 \cdot 10^{+283}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019163 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

  :herbie-target
  (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))