Average Error: 7.0 → 1.4
Time: 4.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 -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r490305 = x;
        double r490306 = y;
        double r490307 = r490305 * r490306;
        double r490308 = z;
        double r490309 = r490308 * r490306;
        double r490310 = r490307 - r490309;
        double r490311 = t;
        double r490312 = r490310 * r490311;
        return r490312;
}

double f(double x, double y, double z, double t) {
        double r490313 = x;
        double r490314 = y;
        double r490315 = r490313 * r490314;
        double r490316 = z;
        double r490317 = r490316 * r490314;
        double r490318 = r490315 - r490317;
        double r490319 = -2.463499167606939e+200;
        bool r490320 = r490318 <= r490319;
        double r490321 = 6.77768871674227e+235;
        bool r490322 = r490318 <= r490321;
        double r490323 = !r490322;
        bool r490324 = r490320 || r490323;
        double r490325 = r490313 - r490316;
        double r490326 = t;
        double r490327 = r490325 * r490326;
        double r490328 = r490314 * r490327;
        double r490329 = -r490317;
        double r490330 = r490315 + r490329;
        double r490331 = r490330 * r490326;
        double r490332 = r490324 ? r490328 : r490331;
        return r490332;
}

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
Herbie1.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 2 regimes
  2. if (- (* x y) (* z y)) < -2.463499167606939e+200 or 6.77768871674227e+235 < (- (* x y) (* z y))

    1. Initial program 32.1

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

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

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

    if -2.463499167606939e+200 < (- (* x y) (* z y)) < 6.77768871674227e+235

    1. Initial program 1.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2019322 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))