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 r507727 = x;
        double r507728 = y;
        double r507729 = r507727 * r507728;
        double r507730 = z;
        double r507731 = r507730 * r507728;
        double r507732 = r507729 - r507731;
        double r507733 = t;
        double r507734 = r507732 * r507733;
        return r507734;
}

double f(double x, double y, double z, double t) {
        double r507735 = y;
        double r507736 = -2.9777692951452427e-72;
        bool r507737 = r507735 <= r507736;
        double r507738 = t;
        double r507739 = x;
        double r507740 = r507738 * r507739;
        double r507741 = r507740 * r507735;
        double r507742 = z;
        double r507743 = -r507742;
        double r507744 = r507743 * r507735;
        double r507745 = r507738 * r507744;
        double r507746 = r507741 + r507745;
        double r507747 = 1.3299380315149737e+99;
        bool r507748 = r507735 <= r507747;
        double r507749 = r507739 * r507735;
        double r507750 = r507738 * r507749;
        double r507751 = cbrt(r507750);
        double r507752 = r507751 * r507751;
        double r507753 = r507752 * r507751;
        double r507754 = r507753 + r507745;
        double r507755 = r507738 * r507735;
        double r507756 = r507739 - r507742;
        double r507757 = r507755 * r507756;
        double r507758 = r507748 ? r507754 : r507757;
        double r507759 = r507737 ? r507746 : r507758;
        return r507759;
}

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