Average Error: 7.1 → 0.4
Time: 15.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.992720354667754811931564301530949164485 \cdot 10^{220}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.396235895919902913371156822147246977413 \cdot 10^{-261}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.234588314730933664591068695313985424095 \cdot 10^{-234}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 4.319761620680668531396215097486412798471 \cdot 10^{234}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -5.992720354667754811931564301530949164485 \cdot 10^{220}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r20891126 = x;
        double r20891127 = y;
        double r20891128 = r20891126 * r20891127;
        double r20891129 = z;
        double r20891130 = r20891129 * r20891127;
        double r20891131 = r20891128 - r20891130;
        double r20891132 = t;
        double r20891133 = r20891131 * r20891132;
        return r20891133;
}

double f(double x, double y, double z, double t) {
        double r20891134 = x;
        double r20891135 = y;
        double r20891136 = r20891134 * r20891135;
        double r20891137 = z;
        double r20891138 = r20891137 * r20891135;
        double r20891139 = r20891136 - r20891138;
        double r20891140 = -5.992720354667755e+220;
        bool r20891141 = r20891139 <= r20891140;
        double r20891142 = r20891134 - r20891137;
        double r20891143 = t;
        double r20891144 = r20891135 * r20891143;
        double r20891145 = r20891142 * r20891144;
        double r20891146 = -2.396235895919903e-261;
        bool r20891147 = r20891139 <= r20891146;
        double r20891148 = r20891143 * r20891139;
        double r20891149 = 2.2345883147309337e-234;
        bool r20891150 = r20891139 <= r20891149;
        double r20891151 = 4.3197616206806685e+234;
        bool r20891152 = r20891139 <= r20891151;
        double r20891153 = r20891143 * r20891142;
        double r20891154 = r20891153 * r20891135;
        double r20891155 = r20891152 ? r20891148 : r20891154;
        double r20891156 = r20891150 ? r20891145 : r20891155;
        double r20891157 = r20891147 ? r20891148 : r20891156;
        double r20891158 = r20891141 ? r20891145 : r20891157;
        return r20891158;
}

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.1
Target2.9
Herbie0.4
\[\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 (- (* x y) (* z y)) < -5.992720354667755e+220 or -2.396235895919903e-261 < (- (* x y) (* z y)) < 2.2345883147309337e-234

    1. Initial program 21.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified0.6

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

    if -5.992720354667755e+220 < (- (* x y) (* z y)) < -2.396235895919903e-261 or 2.2345883147309337e-234 < (- (* x y) (* z y)) < 4.3197616206806685e+234

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if 4.3197616206806685e+234 < (- (* x y) (* z y))

    1. Initial program 38.5

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

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt1.6

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \sqrt[3]{x - z}\right)} \cdot \left(t \cdot y\right)\]
    5. Applied associate-*l*1.6

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

      \[\leadsto \left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot t\right) \cdot y\right)}\]
    8. Using strategy rm
    9. Applied associate-*l*1.4

      \[\leadsto \color{blue}{\sqrt[3]{x - z} \cdot \left(\sqrt[3]{x - z} \cdot \left(\left(\sqrt[3]{x - z} \cdot t\right) \cdot y\right)\right)}\]
    10. Taylor expanded around inf 38.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.992720354667754811931564301530949164485 \cdot 10^{220}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.396235895919902913371156822147246977413 \cdot 10^{-261}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.234588314730933664591068695313985424095 \cdot 10^{-234}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 4.319761620680668531396215097486412798471 \cdot 10^{234}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

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