Average Error: 7.4 → 0.5
Time: 13.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.584792551621188352373764172077868436061 \cdot 10^{224}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.486873513766448555626414525010512525823 \cdot 10^{-187}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.805253723888293891380057854693287178456 \cdot 10^{-171}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.874436852218486952162485620942124118867 \cdot 10^{244}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\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 -5.584792551621188352373764172077868436061 \cdot 10^{224}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r356423 = x;
        double r356424 = y;
        double r356425 = r356423 * r356424;
        double r356426 = z;
        double r356427 = r356426 * r356424;
        double r356428 = r356425 - r356427;
        double r356429 = t;
        double r356430 = r356428 * r356429;
        return r356430;
}

double f(double x, double y, double z, double t) {
        double r356431 = x;
        double r356432 = y;
        double r356433 = r356431 * r356432;
        double r356434 = z;
        double r356435 = r356434 * r356432;
        double r356436 = r356433 - r356435;
        double r356437 = -5.584792551621188e+224;
        bool r356438 = r356436 <= r356437;
        double r356439 = t;
        double r356440 = r356439 * r356432;
        double r356441 = r356431 - r356434;
        double r356442 = r356440 * r356441;
        double r356443 = -3.4868735137664486e-187;
        bool r356444 = r356436 <= r356443;
        double r356445 = r356439 * r356436;
        double r356446 = 2.805253723888294e-171;
        bool r356447 = r356436 <= r356446;
        double r356448 = r356439 * r356441;
        double r356449 = r356432 * r356448;
        double r356450 = 5.874436852218487e+244;
        bool r356451 = r356436 <= r356450;
        double r356452 = r356451 ? r356445 : r356442;
        double r356453 = r356447 ? r356449 : r356452;
        double r356454 = r356444 ? r356445 : r356453;
        double r356455 = r356438 ? r356442 : r356454;
        return r356455;
}

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.4
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)) < -5.584792551621188e+224 or 5.874436852218487e+244 < (- (* x y) (* z y))

    1. Initial program 35.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-commutative35.4

      \[\leadsto \color{blue}{t \cdot \left(x \cdot y - z \cdot y\right)}\]
    4. Using strategy rm
    5. Applied distribute-rgt-out--35.4

      \[\leadsto t \cdot \color{blue}{\left(y \cdot \left(x - z\right)\right)}\]
    6. Applied associate-*r*0.8

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

    if -5.584792551621188e+224 < (- (* x y) (* z y)) < -3.4868735137664486e-187 or 2.805253723888294e-171 < (- (* x y) (* z y)) < 5.874436852218487e+244

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-commutative0.3

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

    if -3.4868735137664486e-187 < (- (* x y) (* z y)) < 2.805253723888294e-171

    1. Initial program 7.9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.584792551621188352373764172077868436061 \cdot 10^{224}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.486873513766448555626414525010512525823 \cdot 10^{-187}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.805253723888293891380057854693287178456 \cdot 10^{-171}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.874436852218486952162485620942124118867 \cdot 10^{244}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

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