Average Error: 7.3 → 0.5
Time: 13.4s
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 r415328 = x;
        double r415329 = y;
        double r415330 = r415328 * r415329;
        double r415331 = z;
        double r415332 = r415331 * r415329;
        double r415333 = r415330 - r415332;
        double r415334 = t;
        double r415335 = r415333 * r415334;
        return r415335;
}

double f(double x, double y, double z, double t) {
        double r415336 = x;
        double r415337 = y;
        double r415338 = r415336 * r415337;
        double r415339 = z;
        double r415340 = r415339 * r415337;
        double r415341 = r415338 - r415340;
        double r415342 = -7.989739191556314e+216;
        bool r415343 = r415341 <= r415342;
        double r415344 = r415336 - r415339;
        double r415345 = t;
        double r415346 = r415337 * r415345;
        double r415347 = r415344 * r415346;
        double r415348 = -3.938606380495146e-271;
        bool r415349 = r415341 <= r415348;
        double r415350 = r415345 * r415341;
        double r415351 = 2.5075929227018375e-155;
        bool r415352 = r415341 <= r415351;
        double r415353 = r415345 * r415344;
        double r415354 = r415353 * r415337;
        double r415355 = 5.452934761896352e+219;
        bool r415356 = r415341 <= r415355;
        double r415357 = r415356 ? r415350 : r415347;
        double r415358 = r415352 ? r415354 : r415357;
        double r415359 = r415349 ? r415350 : r415358;
        double r415360 = r415343 ? r415347 : r415359;
        return r415360;
}

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