Average Error: 7.1 → 0.4
Time: 18.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.799383364711576027464930938393742466839 \cdot 10^{-215} \lor \neg \left(x \cdot y - z \cdot y \le 1.006077055868557144226925658801701949381 \cdot 10^{-309} \lor \neg \left(x \cdot y - z \cdot y \le 4.76299899156281197490365041190058136043 \cdot 10^{186}\right)\right):\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le -1.799383364711576027464930938393742466839 \cdot 10^{-215} \lor \neg \left(x \cdot y - z \cdot y \le 1.006077055868557144226925658801701949381 \cdot 10^{-309} \lor \neg \left(x \cdot y - z \cdot y \le 4.76299899156281197490365041190058136043 \cdot 10^{186}\right)\right):\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r311322 = x;
        double r311323 = y;
        double r311324 = r311322 * r311323;
        double r311325 = z;
        double r311326 = r311325 * r311323;
        double r311327 = r311324 - r311326;
        double r311328 = t;
        double r311329 = r311327 * r311328;
        return r311329;
}

double f(double x, double y, double z, double t) {
        double r311330 = x;
        double r311331 = y;
        double r311332 = r311330 * r311331;
        double r311333 = z;
        double r311334 = r311333 * r311331;
        double r311335 = r311332 - r311334;
        double r311336 = -inf.0;
        bool r311337 = r311335 <= r311336;
        double r311338 = t;
        double r311339 = r311338 * r311331;
        double r311340 = r311330 - r311333;
        double r311341 = r311339 * r311340;
        double r311342 = -1.799383364711576e-215;
        bool r311343 = r311335 <= r311342;
        double r311344 = 1.006077055868557e-309;
        bool r311345 = r311335 <= r311344;
        double r311346 = 4.762998991562812e+186;
        bool r311347 = r311335 <= r311346;
        double r311348 = !r311347;
        bool r311349 = r311345 || r311348;
        double r311350 = !r311349;
        bool r311351 = r311343 || r311350;
        double r311352 = r311338 * r311335;
        double r311353 = r311338 * r311340;
        double r311354 = r311331 * r311353;
        double r311355 = r311351 ? r311352 : r311354;
        double r311356 = r311337 ? r311341 : r311355;
        return r311356;
}

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.1
Target3.1
Herbie0.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 3 regimes
  2. if (- (* x y) (* z y)) < -inf.0

    1. Initial program 64.0

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

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

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

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < -1.799383364711576e-215 or 1.006077055868557e-309 < (- (* x y) (* z y)) < 4.762998991562812e+186

    1. Initial program 0.2

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

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

    if -1.799383364711576e-215 < (- (* x y) (* z y)) < 1.006077055868557e-309 or 4.762998991562812e+186 < (- (* x y) (* z y))

    1. Initial program 20.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.799383364711576027464930938393742466839 \cdot 10^{-215} \lor \neg \left(x \cdot y - z \cdot y \le 1.006077055868557144226925658801701949381 \cdot 10^{-309} \lor \neg \left(x \cdot y - z \cdot y \le 4.76299899156281197490365041190058136043 \cdot 10^{186}\right)\right):\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019306 +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))