Average Error: 6.7 → 0.8
Time: 15.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.476314521829634 \cdot 10^{+219}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.0151411158340177 \cdot 10^{-184}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 0.0:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.1896923838858549 \cdot 10^{+133}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -1.476314521829634 \cdot 10^{+219}:\\
\;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r30305980 = x;
        double r30305981 = y;
        double r30305982 = r30305980 * r30305981;
        double r30305983 = z;
        double r30305984 = r30305983 * r30305981;
        double r30305985 = r30305982 - r30305984;
        double r30305986 = t;
        double r30305987 = r30305985 * r30305986;
        return r30305987;
}

double f(double x, double y, double z, double t) {
        double r30305988 = x;
        double r30305989 = y;
        double r30305990 = r30305988 * r30305989;
        double r30305991 = z;
        double r30305992 = r30305991 * r30305989;
        double r30305993 = r30305990 - r30305992;
        double r30305994 = -1.476314521829634e+219;
        bool r30305995 = r30305993 <= r30305994;
        double r30305996 = t;
        double r30305997 = r30305988 - r30305991;
        double r30305998 = r30305996 * r30305997;
        double r30305999 = r30305998 * r30305989;
        double r30306000 = -1.0151411158340177e-184;
        bool r30306001 = r30305993 <= r30306000;
        double r30306002 = r30305996 * r30305993;
        double r30306003 = 0.0;
        bool r30306004 = r30305993 <= r30306003;
        double r30306005 = 2.1896923838858549e+133;
        bool r30306006 = r30305993 <= r30306005;
        double r30306007 = r30305989 * r30305996;
        double r30306008 = r30305997 * r30306007;
        double r30306009 = r30306006 ? r30306002 : r30306008;
        double r30306010 = r30306004 ? r30305999 : r30306009;
        double r30306011 = r30306001 ? r30306002 : r30306010;
        double r30306012 = r30305995 ? r30305999 : r30306011;
        return r30306012;
}

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
Herbie0.8
\[\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)) < -1.476314521829634e+219 or -1.0151411158340177e-184 < (- (* x y) (* z y)) < 0.0

    1. Initial program 19.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--19.4

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right)} \cdot t\]
    4. Applied associate-*l*0.9

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

    if -1.476314521829634e+219 < (- (* x y) (* z y)) < -1.0151411158340177e-184 or 0.0 < (- (* x y) (* z y)) < 2.1896923838858549e+133

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if 2.1896923838858549e+133 < (- (* x y) (* z y))

    1. Initial program 19.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--19.1

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right)} \cdot t\]
    4. Applied associate-*l*2.6

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\right)}\]
    5. Taylor expanded around inf 19.2

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

      \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(x - z\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.476314521829634 \cdot 10^{+219}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.0151411158340177 \cdot 10^{-184}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 0.0:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.1896923838858549 \cdot 10^{+133}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019164 
(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))