Average Error: 7.0 → 2.5
Time: 14.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 9.353967203451809527016106455487665678901 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r26596248 = x;
        double r26596249 = y;
        double r26596250 = r26596248 * r26596249;
        double r26596251 = z;
        double r26596252 = r26596251 * r26596249;
        double r26596253 = r26596250 - r26596252;
        double r26596254 = t;
        double r26596255 = r26596253 * r26596254;
        return r26596255;
}

double f(double x, double y, double z, double t) {
        double r26596256 = t;
        double r26596257 = -2.1649590822028293e+46;
        bool r26596258 = r26596256 <= r26596257;
        double r26596259 = y;
        double r26596260 = x;
        double r26596261 = z;
        double r26596262 = r26596260 - r26596261;
        double r26596263 = r26596259 * r26596262;
        double r26596264 = r26596263 * r26596256;
        double r26596265 = 9.35396720345181e-36;
        bool r26596266 = r26596256 <= r26596265;
        double r26596267 = r26596256 * r26596262;
        double r26596268 = r26596259 * r26596267;
        double r26596269 = r26596259 * r26596256;
        double r26596270 = r26596269 * r26596262;
        double r26596271 = r26596266 ? r26596268 : r26596270;
        double r26596272 = r26596258 ? r26596264 : r26596271;
        return r26596272;
}

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.2
Herbie2.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 t < -2.1649590822028293e+46

    1. Initial program 3.6

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

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

      \[\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*6.2

      \[\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 3.6

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

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

    if -2.1649590822028293e+46 < t < 9.35396720345181e-36

    1. Initial program 9.3

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

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

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

    if 9.35396720345181e-36 < t

    1. Initial program 2.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 9.353967203451809527016106455487665678901 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

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