Average Error: 6.8 → 1.5
Time: 2.9s
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 = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 9.668620972726255662523660055585238484298 \cdot 10^{283}\right):\\ \;\;\;\;\left(\sqrt[3]{\left(t \cdot y\right) \cdot x} \cdot \left(\sqrt[3]{t \cdot y} \cdot \sqrt[3]{x}\right)\right) \cdot \sqrt[3]{\left(t \cdot y\right) \cdot x} + \left(t \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \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 = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 9.668620972726255662523660055585238484298 \cdot 10^{283}\right):\\
\;\;\;\;\left(\sqrt[3]{\left(t \cdot y\right) \cdot x} \cdot \left(\sqrt[3]{t \cdot y} \cdot \sqrt[3]{x}\right)\right) \cdot \sqrt[3]{\left(t \cdot y\right) \cdot x} + \left(t \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r486441 = x;
        double r486442 = y;
        double r486443 = r486441 * r486442;
        double r486444 = z;
        double r486445 = r486444 * r486442;
        double r486446 = r486443 - r486445;
        double r486447 = t;
        double r486448 = r486446 * r486447;
        return r486448;
}

double f(double x, double y, double z, double t) {
        double r486449 = x;
        double r486450 = y;
        double r486451 = r486449 * r486450;
        double r486452 = z;
        double r486453 = r486452 * r486450;
        double r486454 = r486451 - r486453;
        double r486455 = t;
        double r486456 = r486454 * r486455;
        double r486457 = -inf.0;
        bool r486458 = r486456 <= r486457;
        double r486459 = 9.668620972726256e+283;
        bool r486460 = r486456 <= r486459;
        double r486461 = !r486460;
        bool r486462 = r486458 || r486461;
        double r486463 = r486455 * r486450;
        double r486464 = r486463 * r486449;
        double r486465 = cbrt(r486464);
        double r486466 = cbrt(r486463);
        double r486467 = cbrt(r486449);
        double r486468 = r486466 * r486467;
        double r486469 = r486465 * r486468;
        double r486470 = r486469 * r486465;
        double r486471 = -r486452;
        double r486472 = r486463 * r486471;
        double r486473 = r486470 + r486472;
        double r486474 = r486462 ? r486473 : r486456;
        return r486474;
}

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.8
Target2.9
Herbie1.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 2 regimes
  2. if (* (- (* x y) (* z y)) t) < -inf.0 or 9.668620972726256e+283 < (* (- (* x y) (* z y)) t)

    1. Initial program 57.0

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

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

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

      \[\leadsto \left(t \cdot y\right) \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
    7. Applied distribute-lft-in1.9

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot x + \left(t \cdot y\right) \cdot \left(-z\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt2.4

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(t \cdot y\right) \cdot x} \cdot \sqrt[3]{\left(t \cdot y\right) \cdot x}\right) \cdot \sqrt[3]{\left(t \cdot y\right) \cdot x}} + \left(t \cdot y\right) \cdot \left(-z\right)\]
    10. Using strategy rm
    11. Applied cbrt-prod2.3

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

    if -inf.0 < (* (- (* x y) (* z y)) t) < 9.668620972726256e+283

    1. Initial program 1.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 9.668620972726255662523660055585238484298 \cdot 10^{283}\right):\\ \;\;\;\;\left(\sqrt[3]{\left(t \cdot y\right) \cdot x} \cdot \left(\sqrt[3]{t \cdot y} \cdot \sqrt[3]{x}\right)\right) \cdot \sqrt[3]{\left(t \cdot y\right) \cdot x} + \left(t \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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