Average Error: 7.0 → 4.5
Time: 3.0s
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 r465448 = x;
        double r465449 = y;
        double r465450 = r465448 * r465449;
        double r465451 = z;
        double r465452 = r465451 * r465449;
        double r465453 = r465450 - r465452;
        double r465454 = t;
        double r465455 = r465453 * r465454;
        return r465455;
}

double f(double x, double y, double z, double t) {
        double r465456 = y;
        double r465457 = -2.9777692951452427e-72;
        bool r465458 = r465456 <= r465457;
        double r465459 = t;
        double r465460 = x;
        double r465461 = r465459 * r465460;
        double r465462 = r465461 * r465456;
        double r465463 = z;
        double r465464 = -r465463;
        double r465465 = r465464 * r465456;
        double r465466 = r465459 * r465465;
        double r465467 = r465462 + r465466;
        double r465468 = 1.3299380315149737e+99;
        bool r465469 = r465456 <= r465468;
        double r465470 = r465460 * r465456;
        double r465471 = r465459 * r465470;
        double r465472 = cbrt(r465471);
        double r465473 = r465472 * r465472;
        double r465474 = r465473 * r465472;
        double r465475 = r465474 + r465466;
        double r465476 = r465459 * r465456;
        double r465477 = r465460 - r465463;
        double r465478 = r465476 * r465477;
        double r465479 = r465469 ? r465475 : r465478;
        double r465480 = r465458 ? r465467 : r465479;
        return r465480;
}

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 +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))