Average Error: 7.2 → 0.3
Time: 3.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.21225276859487071 \cdot 10^{-192}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -0.0:\\ \;\;\;\;1 \cdot \left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.14764716923265975 \cdot 10^{228}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\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}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

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

\mathbf{elif}\;x \cdot y - z \cdot y \le 8.14764716923265975 \cdot 10^{228}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\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 r593347 = x;
        double r593348 = y;
        double r593349 = r593347 * r593348;
        double r593350 = z;
        double r593351 = r593350 * r593348;
        double r593352 = r593349 - r593351;
        double r593353 = t;
        double r593354 = r593352 * r593353;
        return r593354;
}

double f(double x, double y, double z, double t) {
        double r593355 = x;
        double r593356 = y;
        double r593357 = r593355 * r593356;
        double r593358 = z;
        double r593359 = r593358 * r593356;
        double r593360 = r593357 - r593359;
        double r593361 = -inf.0;
        bool r593362 = r593360 <= r593361;
        double r593363 = r593355 - r593358;
        double r593364 = t;
        double r593365 = r593363 * r593364;
        double r593366 = r593356 * r593365;
        double r593367 = -2.2122527685948707e-192;
        bool r593368 = r593360 <= r593367;
        double r593369 = r593360 * r593364;
        double r593370 = -0.0;
        bool r593371 = r593360 <= r593370;
        double r593372 = 1.0;
        double r593373 = r593364 * r593356;
        double r593374 = r593373 * r593363;
        double r593375 = r593372 * r593374;
        double r593376 = 8.14764716923266e+228;
        bool r593377 = r593360 <= r593376;
        double r593378 = r593377 ? r593369 : r593366;
        double r593379 = r593371 ? r593375 : r593378;
        double r593380 = r593368 ? r593369 : r593379;
        double r593381 = r593362 ? r593366 : r593380;
        return r593381;
}

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.2
Target2.9
Herbie0.3
\[\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 3 regimes
  2. if (- (* x y) (* z y)) < -inf.0 or 8.14764716923266e+228 < (- (* x y) (* z y))

    1. Initial program 45.7

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < -2.2122527685948707e-192 or -0.0 < (- (* x y) (* z y)) < 8.14764716923266e+228

    1. Initial program 1.2

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

    if -2.2122527685948707e-192 < (- (* x y) (* z y)) < -0.0

    1. Initial program 5.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.21225276859487071 \cdot 10^{-192}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -0.0:\\ \;\;\;\;1 \cdot \left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.14764716923265975 \cdot 10^{228}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :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))