Average Error: 7.4 → 1.3
Time: 17.8s
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 r21563474 = x;
        double r21563475 = y;
        double r21563476 = r21563474 * r21563475;
        double r21563477 = z;
        double r21563478 = r21563477 * r21563475;
        double r21563479 = r21563476 - r21563478;
        double r21563480 = t;
        double r21563481 = r21563479 * r21563480;
        return r21563481;
}

double f(double x, double y, double z, double t) {
        double r21563482 = x;
        double r21563483 = y;
        double r21563484 = r21563482 * r21563483;
        double r21563485 = z;
        double r21563486 = r21563485 * r21563483;
        double r21563487 = r21563484 - r21563486;
        double r21563488 = -6.133846791980699e+284;
        bool r21563489 = r21563487 <= r21563488;
        double r21563490 = r21563482 - r21563485;
        double r21563491 = t;
        double r21563492 = r21563490 * r21563491;
        double r21563493 = r21563492 * r21563483;
        double r21563494 = 7.672543965565523e+216;
        bool r21563495 = r21563487 <= r21563494;
        double r21563496 = r21563491 * r21563487;
        double r21563497 = r21563495 ? r21563496 : r21563493;
        double r21563498 = r21563489 ? r21563493 : r21563497;
        return r21563498;
}

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. 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-*r*1.7

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right) \cdot y}\]
    10. 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 +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))