Average Error: 7.1 → 2.8
Time: 2.9s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.68361982243040008 \cdot 10^{31} \lor \neg \left(t \le 4.2319166616304514 \cdot 10^{-10}\right):\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.68361982243040008 \cdot 10^{31} \lor \neg \left(t \le 4.2319166616304514 \cdot 10^{-10}\right):\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r538510 = x;
        double r538511 = y;
        double r538512 = r538510 * r538511;
        double r538513 = z;
        double r538514 = r538513 * r538511;
        double r538515 = r538512 - r538514;
        double r538516 = t;
        double r538517 = r538515 * r538516;
        return r538517;
}

double f(double x, double y, double z, double t) {
        double r538518 = t;
        double r538519 = -1.6836198224304e+31;
        bool r538520 = r538518 <= r538519;
        double r538521 = 4.2319166616304514e-10;
        bool r538522 = r538518 <= r538521;
        double r538523 = !r538522;
        bool r538524 = r538520 || r538523;
        double r538525 = x;
        double r538526 = z;
        double r538527 = r538525 - r538526;
        double r538528 = y;
        double r538529 = r538518 * r538528;
        double r538530 = r538527 * r538529;
        double r538531 = r538527 * r538518;
        double r538532 = r538531 * r538528;
        double r538533 = r538524 ? r538530 : r538532;
        return r538533;
}

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.1
Target3.3
Herbie2.8
\[\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 < -1.6836198224304e+31 or 4.2319166616304514e-10 < t

    1. Initial program 3.4

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

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

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(x - z\right)}\]
    5. Using strategy rm
    6. Applied *-commutative3.7

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

    if -1.6836198224304e+31 < t < 4.2319166616304514e-10

    1. Initial program 9.3

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

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

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(x - z\right)}\]
    5. Using strategy rm
    6. Applied *-commutative8.6

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

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

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

Reproduce

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