Average Error: 6.8 → 0.3
Time: 9.9s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\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 = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r651518 = x;
        double r651519 = y;
        double r651520 = r651518 * r651519;
        double r651521 = z;
        double r651522 = r651521 * r651519;
        double r651523 = r651520 - r651522;
        double r651524 = t;
        double r651525 = r651523 * r651524;
        return r651525;
}

double f(double x, double y, double z, double t) {
        double r651526 = x;
        double r651527 = y;
        double r651528 = r651526 * r651527;
        double r651529 = z;
        double r651530 = r651529 * r651527;
        double r651531 = r651528 - r651530;
        double r651532 = -inf.0;
        bool r651533 = r651531 <= r651532;
        double r651534 = -2.4567647858069996e-247;
        bool r651535 = r651531 <= r651534;
        double r651536 = 1.8871265358838337e-270;
        bool r651537 = r651531 <= r651536;
        double r651538 = !r651537;
        double r651539 = 2.097560004769073e+298;
        bool r651540 = r651531 <= r651539;
        bool r651541 = r651538 && r651540;
        bool r651542 = r651535 || r651541;
        double r651543 = !r651542;
        bool r651544 = r651533 || r651543;
        double r651545 = r651526 - r651529;
        double r651546 = t;
        double r651547 = r651545 * r651546;
        double r651548 = r651527 * r651547;
        double r651549 = r651531 * r651546;
        double r651550 = r651544 ? r651548 : r651549;
        return r651550;
}

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

Original6.8
Target3.0
Herbie0.3
\[\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 (- (* x y) (* z y)) < -inf.0 or -2.4567647858069996e-247 < (- (* x y) (* z y)) < 1.8871265358838337e-270 or 2.097560004769073e+298 < (- (* x y) (* z y))

    1. Initial program 38.1

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

      \[\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)}\]

    if -inf.0 < (- (* x y) (* z y)) < -2.4567647858069996e-247 or 1.8871265358838337e-270 < (- (* x y) (* z y)) < 2.097560004769073e+298

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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