Average Error: 7.2 → 1.7
Time: 3.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -4.20560211460467888 \cdot 10^{58}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 0.0:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 2.8915212837881257 \cdot 10^{305}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \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}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -4.20560211460467888 \cdot 10^{58}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

\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 r539543 = x;
        double r539544 = y;
        double r539545 = r539543 * r539544;
        double r539546 = z;
        double r539547 = r539546 * r539544;
        double r539548 = r539545 - r539547;
        double r539549 = t;
        double r539550 = r539548 * r539549;
        return r539550;
}

double f(double x, double y, double z, double t) {
        double r539551 = x;
        double r539552 = y;
        double r539553 = r539551 * r539552;
        double r539554 = z;
        double r539555 = r539554 * r539552;
        double r539556 = r539553 - r539555;
        double r539557 = t;
        double r539558 = r539556 * r539557;
        double r539559 = -4.205602114604679e+58;
        bool r539560 = r539558 <= r539559;
        double r539561 = r539557 * r539552;
        double r539562 = r539551 - r539554;
        double r539563 = r539561 * r539562;
        double r539564 = 0.0;
        bool r539565 = r539558 <= r539564;
        double r539566 = r539562 * r539557;
        double r539567 = r539552 * r539566;
        double r539568 = 2.8915212837881257e+305;
        bool r539569 = r539558 <= r539568;
        double r539570 = r539569 ? r539558 : r539563;
        double r539571 = r539565 ? r539567 : r539570;
        double r539572 = r539560 ? r539563 : r539571;
        return r539572;
}

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
Target3.3
Herbie1.7
\[\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 3 regimes
  2. if (* (- (* x y) (* z y)) t) < -4.205602114604679e+58 or 2.8915212837881257e+305 < (* (- (* x y) (* z y)) t)

    1. Initial program 23.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Taylor expanded around inf 23.1

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

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

    if -4.205602114604679e+58 < (* (- (* x y) (* z y)) t) < 0.0

    1. Initial program 3.3

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

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

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

    if 0.0 < (* (- (* x y) (* z y)) t) < 2.8915212837881257e+305

    1. Initial program 0.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -4.20560211460467888 \cdot 10^{58}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 0.0:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;\left(x \cdot y - z \cdot y\right) \cdot t \le 2.8915212837881257 \cdot 10^{305}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020081 +o rules:numerics
(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))