Average Error: 7.4 → 1.3
Time: 20.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.672543965565522914861491129068386395846 \cdot 10^{216}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\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 -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\
\;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r27303341 = x;
        double r27303342 = y;
        double r27303343 = r27303341 * r27303342;
        double r27303344 = z;
        double r27303345 = r27303344 * r27303342;
        double r27303346 = r27303343 - r27303345;
        double r27303347 = t;
        double r27303348 = r27303346 * r27303347;
        return r27303348;
}

double f(double x, double y, double z, double t) {
        double r27303349 = x;
        double r27303350 = y;
        double r27303351 = r27303349 * r27303350;
        double r27303352 = z;
        double r27303353 = r27303352 * r27303350;
        double r27303354 = r27303351 - r27303353;
        double r27303355 = -6.133846791980699e+284;
        bool r27303356 = r27303354 <= r27303355;
        double r27303357 = r27303349 - r27303352;
        double r27303358 = t;
        double r27303359 = r27303357 * r27303358;
        double r27303360 = r27303359 * r27303350;
        double r27303361 = 7.672543965565523e+216;
        bool r27303362 = r27303354 <= r27303361;
        double r27303363 = r27303358 * r27303354;
        double r27303364 = r27303362 ? r27303363 : r27303360;
        double r27303365 = r27303356 ? r27303360 : r27303364;
        return r27303365;
}

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.4
Target2.9
Herbie1.3
\[\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 2 regimes
  2. if (- (* x y) (* z y)) < -6.133846791980699e+284 or 7.672543965565523e+216 < (- (* x y) (* z y))

    1. Initial program 39.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)}\]
    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.7

      \[\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. Taylor expanded around inf 39.4

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

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

    if -6.133846791980699e+284 < (- (* x y) (* z y)) < 7.672543965565523e+216

    1. Initial program 1.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -6.133846791980698737846108317463776184574 \cdot 10^{284}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.672543965565522914861491129068386395846 \cdot 10^{216}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \end{array}\]

Reproduce

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