Average Error: 7.3 → 0.5
Time: 14.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 -7.989739191556314118675411400676898473705 \cdot 10^{216}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.938606380495146233818773706251095406329 \cdot 10^{-271}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.507592922701837483746017388271332707636 \cdot 10^{-155}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.452934761896352125839053618417268799266 \cdot 10^{219}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \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 \le -7.989739191556314118675411400676898473705 \cdot 10^{216}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r426368 = x;
        double r426369 = y;
        double r426370 = r426368 * r426369;
        double r426371 = z;
        double r426372 = r426371 * r426369;
        double r426373 = r426370 - r426372;
        double r426374 = t;
        double r426375 = r426373 * r426374;
        return r426375;
}

double f(double x, double y, double z, double t) {
        double r426376 = x;
        double r426377 = y;
        double r426378 = r426376 * r426377;
        double r426379 = z;
        double r426380 = r426379 * r426377;
        double r426381 = r426378 - r426380;
        double r426382 = -7.989739191556314e+216;
        bool r426383 = r426381 <= r426382;
        double r426384 = r426376 - r426379;
        double r426385 = t;
        double r426386 = r426377 * r426385;
        double r426387 = r426384 * r426386;
        double r426388 = -3.938606380495146e-271;
        bool r426389 = r426381 <= r426388;
        double r426390 = r426385 * r426381;
        double r426391 = 2.5075929227018375e-155;
        bool r426392 = r426381 <= r426391;
        double r426393 = r426385 * r426384;
        double r426394 = r426393 * r426377;
        double r426395 = 5.452934761896352e+219;
        bool r426396 = r426381 <= r426395;
        double r426397 = r426396 ? r426390 : r426387;
        double r426398 = r426392 ? r426394 : r426397;
        double r426399 = r426389 ? r426390 : r426398;
        double r426400 = r426383 ? r426387 : r426399;
        return r426400;
}

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.3
Herbie0.5
\[\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 3 regimes
  2. if (- (* x y) (* z y)) < -7.989739191556314e+216 or 5.452934761896352e+219 < (- (* x y) (* z y))

    1. Initial program 32.3

      \[\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)}\]

    if -7.989739191556314e+216 < (- (* x y) (* z y)) < -3.938606380495146e-271 or 2.5075929227018375e-155 < (- (* x y) (* z y)) < 5.452934761896352e+219

    1. Initial program 0.3

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

    if -3.938606380495146e-271 < (- (* x y) (* z y)) < 2.5075929227018375e-155

    1. Initial program 9.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -7.989739191556314118675411400676898473705 \cdot 10^{216}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.938606380495146233818773706251095406329 \cdot 10^{-271}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.507592922701837483746017388271332707636 \cdot 10^{-155}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.452934761896352125839053618417268799266 \cdot 10^{219}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(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))