Average Error: 6.7 → 1.4
Time: 11.1s
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 1.2122805582373037 \cdot 10^{+206}:\\ \;\;\;\;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 1.2122805582373037 \cdot 10^{+206}:\\
\;\;\;\;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 r24680406 = x;
        double r24680407 = y;
        double r24680408 = r24680406 * r24680407;
        double r24680409 = z;
        double r24680410 = r24680409 * r24680407;
        double r24680411 = r24680408 - r24680410;
        double r24680412 = t;
        double r24680413 = r24680411 * r24680412;
        return r24680413;
}

double f(double x, double y, double z, double t) {
        double r24680414 = x;
        double r24680415 = y;
        double r24680416 = r24680414 * r24680415;
        double r24680417 = z;
        double r24680418 = r24680417 * r24680415;
        double r24680419 = r24680416 - r24680418;
        double r24680420 = -inf.0;
        bool r24680421 = r24680419 <= r24680420;
        double r24680422 = r24680414 - r24680417;
        double r24680423 = t;
        double r24680424 = r24680415 * r24680423;
        double r24680425 = r24680422 * r24680424;
        double r24680426 = 1.2122805582373037e+206;
        bool r24680427 = r24680419 <= r24680426;
        double r24680428 = r24680423 * r24680419;
        double r24680429 = r24680423 * r24680422;
        double r24680430 = r24680429 * r24680415;
        double r24680431 = r24680427 ? r24680428 : r24680430;
        double r24680432 = r24680421 ? r24680425 : r24680431;
        return r24680432;
}

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

Original6.7
Target3.1
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886777 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877 \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

    1. Initial program 60.0

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

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

    if -inf.0 < (- (* x y) (* z y)) < 1.2122805582373037e+206

    1. Initial program 1.5

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

    if 1.2122805582373037e+206 < (- (* x y) (* z y))

    1. Initial program 28.8

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

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

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

    \[\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 1.2122805582373037 \cdot 10^{+206}:\\ \;\;\;\;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 2019165 
(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))