Average Error: 6.9 → 0.5
Time: 13.0s
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.3051966934809397 \cdot 10^{-153}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.7178429536978092 \cdot 10^{-196}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.555835303684123 \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.3051966934809397 \cdot 10^{-153}:\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

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

\mathbf{elif}\;x \cdot y - z \cdot y \le 9.555835303684123 \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 r24148429 = x;
        double r24148430 = y;
        double r24148431 = r24148429 * r24148430;
        double r24148432 = z;
        double r24148433 = r24148432 * r24148430;
        double r24148434 = r24148431 - r24148433;
        double r24148435 = t;
        double r24148436 = r24148434 * r24148435;
        return r24148436;
}

double f(double x, double y, double z, double t) {
        double r24148437 = x;
        double r24148438 = y;
        double r24148439 = r24148437 * r24148438;
        double r24148440 = z;
        double r24148441 = r24148440 * r24148438;
        double r24148442 = r24148439 - r24148441;
        double r24148443 = -inf.0;
        bool r24148444 = r24148442 <= r24148443;
        double r24148445 = r24148437 - r24148440;
        double r24148446 = t;
        double r24148447 = r24148438 * r24148446;
        double r24148448 = r24148445 * r24148447;
        double r24148449 = -3.3051966934809397e-153;
        bool r24148450 = r24148442 <= r24148449;
        double r24148451 = r24148446 * r24148442;
        double r24148452 = 1.7178429536978092e-196;
        bool r24148453 = r24148442 <= r24148452;
        double r24148454 = 9.555835303684123e+230;
        bool r24148455 = r24148442 <= r24148454;
        double r24148456 = r24148446 * r24148445;
        double r24148457 = r24148456 * r24148438;
        double r24148458 = r24148455 ? r24148451 : r24148457;
        double r24148459 = r24148453 ? r24148448 : r24148458;
        double r24148460 = r24148450 ? r24148451 : r24148459;
        double r24148461 = r24148444 ? r24148448 : r24148460;
        return r24148461;
}

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.9
Target3.0
Herbie0.5
\[\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 or -3.3051966934809397e-153 < (- (* x y) (* z y)) < 1.7178429536978092e-196

    1. Initial program 18.6

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

      \[\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 34.0

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--33.8

      \[\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)}\]
  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.3051966934809397 \cdot 10^{-153}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.7178429536978092 \cdot 10^{-196}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.555835303684123 \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))