Average Error: 7.2 → 3.4
Time: 2.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.3940406232685285 \cdot 10^{51} \lor \neg \left(t \le 4.4280824540954636 \cdot 10^{136}\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -2.3940406232685285 \cdot 10^{51} \lor \neg \left(t \le 4.4280824540954636 \cdot 10^{136}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r538557 = x;
        double r538558 = y;
        double r538559 = r538557 * r538558;
        double r538560 = z;
        double r538561 = r538560 * r538558;
        double r538562 = r538559 - r538561;
        double r538563 = t;
        double r538564 = r538562 * r538563;
        return r538564;
}

double f(double x, double y, double z, double t) {
        double r538565 = t;
        double r538566 = -2.3940406232685285e+51;
        bool r538567 = r538565 <= r538566;
        double r538568 = 4.4280824540954636e+136;
        bool r538569 = r538565 <= r538568;
        double r538570 = !r538569;
        bool r538571 = r538567 || r538570;
        double r538572 = y;
        double r538573 = x;
        double r538574 = z;
        double r538575 = r538573 - r538574;
        double r538576 = r538572 * r538575;
        double r538577 = r538565 * r538576;
        double r538578 = r538575 * r538565;
        double r538579 = r538572 * r538578;
        double r538580 = r538571 ? r538577 : r538579;
        return r538580;
}

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.2
Target2.9
Herbie3.4
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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 2 regimes
  2. if t < -2.3940406232685285e+51 or 4.4280824540954636e+136 < t

    1. Initial program 4.1

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

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

    if -2.3940406232685285e+51 < t < 4.4280824540954636e+136

    1. Initial program 8.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.3940406232685285 \cdot 10^{51} \lor \neg \left(t \le 4.4280824540954636 \cdot 10^{136}\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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