Average Error: 7.3 → 0.5
Time: 33.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.305196693480939713514581034193979623053 \cdot 10^{-153}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.717842953697809163237341802420612798171 \cdot 10^{-196}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.555835303684123458062564353397121419313 \cdot 10^{230}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r25912336 = x;
        double r25912337 = y;
        double r25912338 = r25912336 * r25912337;
        double r25912339 = z;
        double r25912340 = r25912339 * r25912337;
        double r25912341 = r25912338 - r25912340;
        double r25912342 = t;
        double r25912343 = r25912341 * r25912342;
        return r25912343;
}

double f(double x, double y, double z, double t) {
        double r25912344 = x;
        double r25912345 = y;
        double r25912346 = r25912344 * r25912345;
        double r25912347 = z;
        double r25912348 = r25912347 * r25912345;
        double r25912349 = r25912346 - r25912348;
        double r25912350 = -inf.0;
        bool r25912351 = r25912349 <= r25912350;
        double r25912352 = r25912344 - r25912347;
        double r25912353 = t;
        double r25912354 = r25912345 * r25912353;
        double r25912355 = r25912352 * r25912354;
        double r25912356 = -3.3051966934809397e-153;
        bool r25912357 = r25912349 <= r25912356;
        double r25912358 = r25912353 * r25912349;
        double r25912359 = 1.7178429536978092e-196;
        bool r25912360 = r25912349 <= r25912359;
        double r25912361 = 9.555835303684123e+230;
        bool r25912362 = r25912349 <= r25912361;
        double r25912363 = r25912353 * r25912352;
        double r25912364 = r25912363 * r25912345;
        double r25912365 = r25912362 ? r25912358 : r25912364;
        double r25912366 = r25912360 ? r25912355 : r25912365;
        double r25912367 = r25912357 ? r25912358 : r25912366;
        double r25912368 = r25912351 ? r25912355 : r25912367;
        return r25912368;
}

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.1
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)) < -inf.0 or -3.3051966934809397e-153 < (- (* x y) (* z y)) < 1.7178429536978092e-196

    1. Initial program 19.4

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

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

    if -inf.0 < (- (* x y) (* z y)) < -3.3051966934809397e-153 or 1.7178429536978092e-196 < (- (* x y) (* z y)) < 9.555835303684123e+230

    1. Initial program 0.3

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

    if 9.555835303684123e+230 < (- (* x y) (* z y))

    1. Initial program 36.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified0.7

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

      \[\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 = -\infty:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.305196693480939713514581034193979623053 \cdot 10^{-153}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.717842953697809163237341802420612798171 \cdot 10^{-196}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.555835303684123458062564353397121419313 \cdot 10^{230}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]

Reproduce

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