Average Error: 7.8 → 3.4
Time: 10.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.2635439128537848 \cdot 10^{-141} \lor \neg \left(y \le 8.87943782307984137 \cdot 10^{82}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -5.2635439128537848 \cdot 10^{-141} \lor \neg \left(y \le 8.87943782307984137 \cdot 10^{82}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r602387 = x;
        double r602388 = y;
        double r602389 = r602387 * r602388;
        double r602390 = z;
        double r602391 = r602390 * r602388;
        double r602392 = r602389 - r602391;
        double r602393 = t;
        double r602394 = r602392 * r602393;
        return r602394;
}

double f(double x, double y, double z, double t) {
        double r602395 = y;
        double r602396 = -5.263543912853785e-141;
        bool r602397 = r602395 <= r602396;
        double r602398 = 8.879437823079841e+82;
        bool r602399 = r602395 <= r602398;
        double r602400 = !r602399;
        bool r602401 = r602397 || r602400;
        double r602402 = x;
        double r602403 = z;
        double r602404 = r602402 - r602403;
        double r602405 = t;
        double r602406 = r602404 * r602405;
        double r602407 = r602395 * r602406;
        double r602408 = r602395 * r602404;
        double r602409 = r602408 * r602405;
        double r602410 = r602401 ? r602407 : r602409;
        return r602410;
}

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.8
Target3.0
Herbie3.4
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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 y < -5.263543912853785e-141 or 8.879437823079841e+82 < y

    1. Initial program 13.5

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

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

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

    if -5.263543912853785e-141 < y < 8.879437823079841e+82

    1. Initial program 3.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -5.2635439128537848 \cdot 10^{-141} \lor \neg \left(y \le 8.87943782307984137 \cdot 10^{82}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :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))