Average Error: 7.3 → 2.6
Time: 10.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43} \lor \neg \left(t \le 4.383754077655976613317179994750942702301 \cdot 10^{51}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43} \lor \neg \left(t \le 4.383754077655976613317179994750942702301 \cdot 10^{51}\right):\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r339386 = x;
        double r339387 = y;
        double r339388 = r339386 * r339387;
        double r339389 = z;
        double r339390 = r339389 * r339387;
        double r339391 = r339388 - r339390;
        double r339392 = t;
        double r339393 = r339391 * r339392;
        return r339393;
}

double f(double x, double y, double z, double t) {
        double r339394 = t;
        double r339395 = -1.5532825872632527e+43;
        bool r339396 = r339394 <= r339395;
        double r339397 = 4.3837540776559766e+51;
        bool r339398 = r339394 <= r339397;
        double r339399 = !r339398;
        bool r339400 = r339396 || r339399;
        double r339401 = y;
        double r339402 = x;
        double r339403 = z;
        double r339404 = r339402 - r339403;
        double r339405 = r339401 * r339404;
        double r339406 = r339405 * r339394;
        double r339407 = r339404 * r339394;
        double r339408 = r339401 * r339407;
        double r339409 = r339400 ? r339406 : r339408;
        return r339409;
}

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.3
Target3.0
Herbie2.6
\[\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 t < -1.5532825872632527e+43 or 4.3837540776559766e+51 < t

    1. Initial program 3.9

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

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

    if -1.5532825872632527e+43 < t < 4.3837540776559766e+51

    1. Initial program 8.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43} \lor \neg \left(t \le 4.383754077655976613317179994750942702301 \cdot 10^{51}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019208 +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.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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