Average Error: 7.3 → 3.2
Time: 9.4s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\right):\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r335381 = x;
        double r335382 = y;
        double r335383 = r335381 * r335382;
        double r335384 = z;
        double r335385 = r335384 * r335382;
        double r335386 = r335383 - r335385;
        double r335387 = t;
        double r335388 = r335386 * r335387;
        return r335388;
}

double f(double x, double y, double z, double t) {
        double r335389 = t;
        double r335390 = -4.079248937665295e-09;
        bool r335391 = r335389 <= r335390;
        double r335392 = 1.2796125811076182e+112;
        bool r335393 = r335389 <= r335392;
        double r335394 = !r335393;
        bool r335395 = r335391 || r335394;
        double r335396 = y;
        double r335397 = x;
        double r335398 = z;
        double r335399 = r335397 - r335398;
        double r335400 = r335396 * r335399;
        double r335401 = r335400 * r335389;
        double r335402 = r335399 * r335389;
        double r335403 = r335396 * r335402;
        double r335404 = r335395 ? r335401 : r335403;
        return r335404;
}

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.3
Target3.1
Herbie3.2
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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 t < -4.079248937665295e-09 or 1.2796125811076182e+112 < t

    1. Initial program 4.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified4.3

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

    if -4.079248937665295e-09 < t < 1.2796125811076182e+112

    1. Initial program 8.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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