Average Error: 7.0 → 4.5
Time: 2.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.977769295145242659502504364676573176105 \cdot 10^{-72}:\\ \;\;\;\;\left(t \cdot x\right) \cdot y + t \cdot \left(\left(-z\right) \cdot y\right)\\ \mathbf{elif}\;y \le 1.329938031514973749605620809522139604149 \cdot 10^{99}:\\ \;\;\;\;\left(\sqrt[3]{t \cdot \left(x \cdot y\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)} + t \cdot \left(\left(-z\right) \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}\;y \le -2.977769295145242659502504364676573176105 \cdot 10^{-72}:\\
\;\;\;\;\left(t \cdot x\right) \cdot y + t \cdot \left(\left(-z\right) \cdot y\right)\\

\mathbf{elif}\;y \le 1.329938031514973749605620809522139604149 \cdot 10^{99}:\\
\;\;\;\;\left(\sqrt[3]{t \cdot \left(x \cdot y\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)} + t \cdot \left(\left(-z\right) \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 r774441 = x;
        double r774442 = y;
        double r774443 = r774441 * r774442;
        double r774444 = z;
        double r774445 = r774444 * r774442;
        double r774446 = r774443 - r774445;
        double r774447 = t;
        double r774448 = r774446 * r774447;
        return r774448;
}

double f(double x, double y, double z, double t) {
        double r774449 = y;
        double r774450 = -2.9777692951452427e-72;
        bool r774451 = r774449 <= r774450;
        double r774452 = t;
        double r774453 = x;
        double r774454 = r774452 * r774453;
        double r774455 = r774454 * r774449;
        double r774456 = z;
        double r774457 = -r774456;
        double r774458 = r774457 * r774449;
        double r774459 = r774452 * r774458;
        double r774460 = r774455 + r774459;
        double r774461 = 1.3299380315149737e+99;
        bool r774462 = r774449 <= r774461;
        double r774463 = r774453 * r774449;
        double r774464 = r774452 * r774463;
        double r774465 = cbrt(r774464);
        double r774466 = r774465 * r774465;
        double r774467 = r774466 * r774465;
        double r774468 = r774467 + r774459;
        double r774469 = r774452 * r774449;
        double r774470 = r774453 - r774456;
        double r774471 = r774469 * r774470;
        double r774472 = r774462 ? r774468 : r774471;
        double r774473 = r774451 ? r774460 : r774472;
        return r774473;
}

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.0
Target3.0
Herbie4.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 y < -2.9777692951452427e-72

    1. Initial program 11.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified11.5

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

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

      \[\leadsto t \cdot \color{blue}{\left(y \cdot x + y \cdot \left(-z\right)\right)}\]
    6. Applied distribute-lft-in11.5

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

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

      \[\leadsto t \cdot \left(x \cdot y\right) + \color{blue}{t \cdot \left(\left(-z\right) \cdot y\right)}\]
    9. Using strategy rm
    10. Applied associate-*r*7.7

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

    if -2.9777692951452427e-72 < y < 1.3299380315149737e+99

    1. Initial program 2.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.7

      \[\leadsto \color{blue}{t \cdot \left(y \cdot \left(x - z\right)\right)}\]
    3. Using strategy rm
    4. Applied sub-neg2.7

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

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

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

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

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

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

    if 1.3299380315149737e+99 < y

    1. Initial program 21.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified21.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.977769295145242659502504364676573176105 \cdot 10^{-72}:\\ \;\;\;\;\left(t \cdot x\right) \cdot y + t \cdot \left(\left(-z\right) \cdot y\right)\\ \mathbf{elif}\;y \le 1.329938031514973749605620809522139604149 \cdot 10^{99}:\\ \;\;\;\;\left(\sqrt[3]{t \cdot \left(x \cdot y\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot y\right)} + t \cdot \left(\left(-z\right) \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

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