Average Error: 7.2 → 0.5
Time: 11.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -3.05444158092502344 \cdot 10^{286} \lor \neg \left(x \cdot y - z \cdot y \le -5.59832323097836096 \cdot 10^{-161} \lor \neg \left(x \cdot y - z \cdot y \le 1.4822 \cdot 10^{-323}\right) \land x \cdot y - z \cdot y \le 3.1817144735460404 \cdot 10^{282}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -3.05444158092502344 \cdot 10^{286} \lor \neg \left(x \cdot y - z \cdot y \le -5.59832323097836096 \cdot 10^{-161} \lor \neg \left(x \cdot y - z \cdot y \le 1.4822 \cdot 10^{-323}\right) \land x \cdot y - z \cdot y \le 3.1817144735460404 \cdot 10^{282}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r806418 = x;
        double r806419 = y;
        double r806420 = r806418 * r806419;
        double r806421 = z;
        double r806422 = r806421 * r806419;
        double r806423 = r806420 - r806422;
        double r806424 = t;
        double r806425 = r806423 * r806424;
        return r806425;
}

double f(double x, double y, double z, double t) {
        double r806426 = x;
        double r806427 = y;
        double r806428 = r806426 * r806427;
        double r806429 = z;
        double r806430 = r806429 * r806427;
        double r806431 = r806428 - r806430;
        double r806432 = -3.0544415809250234e+286;
        bool r806433 = r806431 <= r806432;
        double r806434 = -5.598323230978361e-161;
        bool r806435 = r806431 <= r806434;
        double r806436 = 1.4821969375237e-323;
        bool r806437 = r806431 <= r806436;
        double r806438 = !r806437;
        double r806439 = 3.1817144735460404e+282;
        bool r806440 = r806431 <= r806439;
        bool r806441 = r806438 && r806440;
        bool r806442 = r806435 || r806441;
        double r806443 = !r806442;
        bool r806444 = r806433 || r806443;
        double r806445 = r806426 - r806429;
        double r806446 = t;
        double r806447 = r806445 * r806446;
        double r806448 = r806427 * r806447;
        double r806449 = r806431 * r806446;
        double r806450 = r806444 ? r806448 : r806449;
        return r806450;
}

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
Target3.1
Herbie0.5
\[\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 (- (* x y) (* z y)) < -3.0544415809250234e+286 or -5.598323230978361e-161 < (- (* x y) (* z y)) < 1.4821969375237e-323 or 3.1817144735460404e+282 < (- (* x y) (* z y))

    1. Initial program 30.6

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

      \[\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 -3.0544415809250234e+286 < (- (* x y) (* z y)) < -5.598323230978361e-161 or 1.4821969375237e-323 < (- (* x y) (* z y)) < 3.1817144735460404e+282

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -3.05444158092502344 \cdot 10^{286} \lor \neg \left(x \cdot y - z \cdot y \le -5.59832323097836096 \cdot 10^{-161} \lor \neg \left(x \cdot y - z \cdot y \le 1.4822 \cdot 10^{-323}\right) \land x \cdot y - z \cdot y \le 3.1817144735460404 \cdot 10^{282}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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