Average Error: 7.2 → 0.5
Time: 11.5s
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 r226376 = x;
        double r226377 = y;
        double r226378 = r226376 * r226377;
        double r226379 = z;
        double r226380 = r226379 * r226377;
        double r226381 = r226378 - r226380;
        double r226382 = t;
        double r226383 = r226381 * r226382;
        return r226383;
}

double f(double x, double y, double z, double t) {
        double r226384 = x;
        double r226385 = y;
        double r226386 = r226384 * r226385;
        double r226387 = z;
        double r226388 = r226387 * r226385;
        double r226389 = r226386 - r226388;
        double r226390 = -3.0544415809250234e+286;
        bool r226391 = r226389 <= r226390;
        double r226392 = -5.598323230978361e-161;
        bool r226393 = r226389 <= r226392;
        double r226394 = 1.4821969375237e-323;
        bool r226395 = r226389 <= r226394;
        double r226396 = !r226395;
        double r226397 = 3.1817144735460404e+282;
        bool r226398 = r226389 <= r226397;
        bool r226399 = r226396 && r226398;
        bool r226400 = r226393 || r226399;
        double r226401 = !r226400;
        bool r226402 = r226391 || r226401;
        double r226403 = r226384 - r226387;
        double r226404 = t;
        double r226405 = r226403 * r226404;
        double r226406 = r226385 * r226405;
        double r226407 = r226389 * r226404;
        double r226408 = r226402 ? r226406 : r226407;
        return r226408;
}

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