Average Error: 6.9 → 0.4
Time: 11.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.838984261423296633673495406852766881499 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.584401045790907446074774340867010475211 \cdot 10^{-151}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\ \;\;\;\;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 -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

\mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\
\;\;\;\;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 r405219 = x;
        double r405220 = y;
        double r405221 = r405219 * r405220;
        double r405222 = z;
        double r405223 = r405222 * r405220;
        double r405224 = r405221 - r405223;
        double r405225 = t;
        double r405226 = r405224 * r405225;
        return r405226;
}

double f(double x, double y, double z, double t) {
        double r405227 = x;
        double r405228 = y;
        double r405229 = r405227 * r405228;
        double r405230 = z;
        double r405231 = r405230 * r405228;
        double r405232 = r405229 - r405231;
        double r405233 = -8.19566948968161e+239;
        bool r405234 = r405232 <= r405233;
        double r405235 = t;
        double r405236 = r405235 * r405228;
        double r405237 = r405227 - r405230;
        double r405238 = r405236 * r405237;
        double r405239 = -3.838984261423297e-245;
        bool r405240 = r405232 <= r405239;
        double r405241 = r405235 * r405232;
        double r405242 = 1.5844010457909074e-151;
        bool r405243 = r405232 <= r405242;
        double r405244 = 8.478040016997892e+211;
        bool r405245 = r405232 <= r405244;
        double r405246 = r405235 * r405237;
        double r405247 = r405246 * r405228;
        double r405248 = r405245 ? r405241 : r405247;
        double r405249 = r405243 ? r405238 : r405248;
        double r405250 = r405240 ? r405241 : r405249;
        double r405251 = r405234 ? r405238 : r405250;
        return r405251;
}

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.9
Target3.2
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)) < -8.19566948968161e+239 or -3.838984261423297e-245 < (- (* x y) (* z y)) < 1.5844010457909074e-151

    1. Initial program 17.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied pow117.9

      \[\leadsto \left(x \cdot y - z \cdot y\right) \cdot \color{blue}{{t}^{1}}\]
    4. Applied pow117.9

      \[\leadsto \color{blue}{{\left(x \cdot y - z \cdot y\right)}^{1}} \cdot {t}^{1}\]
    5. Applied pow-prod-down17.9

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

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

    if -8.19566948968161e+239 < (- (* x y) (* z y)) < -3.838984261423297e-245 or 1.5844010457909074e-151 < (- (* x y) (* z y)) < 8.478040016997892e+211

    1. Initial program 0.2

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

    if 8.478040016997892e+211 < (- (* x y) (* z y))

    1. Initial program 29.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--29.4

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right)} \cdot t\]
    4. Applied associate-*l*0.9

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\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 -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.838984261423296633673495406852766881499 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.584401045790907446074774340867010475211 \cdot 10^{-151}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\ \;\;\;\;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 2019194 
(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))