Average Error: 7.4 → 1.3
Time: 18.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 -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.672543965565522914861491129068386395846 \cdot 10^{216}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\
\;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r33366115 = x;
        double r33366116 = y;
        double r33366117 = r33366115 * r33366116;
        double r33366118 = z;
        double r33366119 = r33366118 * r33366116;
        double r33366120 = r33366117 - r33366119;
        double r33366121 = t;
        double r33366122 = r33366120 * r33366121;
        return r33366122;
}

double f(double x, double y, double z, double t) {
        double r33366123 = x;
        double r33366124 = y;
        double r33366125 = r33366123 * r33366124;
        double r33366126 = z;
        double r33366127 = r33366126 * r33366124;
        double r33366128 = r33366125 - r33366127;
        double r33366129 = -6.133846791980699e+284;
        bool r33366130 = r33366128 <= r33366129;
        double r33366131 = r33366123 - r33366126;
        double r33366132 = t;
        double r33366133 = r33366131 * r33366132;
        double r33366134 = r33366133 * r33366124;
        double r33366135 = 7.672543965565523e+216;
        bool r33366136 = r33366128 <= r33366135;
        double r33366137 = r33366132 * r33366128;
        double r33366138 = r33366136 ? r33366137 : r33366134;
        double r33366139 = r33366130 ? r33366134 : r33366138;
        return r33366139;
}

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

Original7.4
Target2.9
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \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 2 regimes
  2. if (- (* x y) (* z y)) < -6.133846791980699e+284 or 7.672543965565523e+216 < (- (* x y) (* z y))

    1. Initial program 39.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified0.6

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt1.6

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \sqrt[3]{x - z}\right)} \cdot \left(t \cdot y\right)\]
    5. Applied associate-*l*1.7

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right) \cdot y}\]
    10. Simplified0.7

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

    if -6.133846791980699e+284 < (- (* x y) (* z y)) < 7.672543965565523e+216

    1. Initial program 1.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.672543965565522914861491129068386395846 \cdot 10^{216}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \end{array}\]

Reproduce

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