Average Error: 7.3 → 3.2
Time: 13.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\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 -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\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 r370009 = x;
        double r370010 = y;
        double r370011 = r370009 * r370010;
        double r370012 = z;
        double r370013 = r370012 * r370010;
        double r370014 = r370011 - r370013;
        double r370015 = t;
        double r370016 = r370014 * r370015;
        return r370016;
}

double f(double x, double y, double z, double t) {
        double r370017 = t;
        double r370018 = -4.079248937665295e-09;
        bool r370019 = r370017 <= r370018;
        double r370020 = 1.2796125811076182e+112;
        bool r370021 = r370017 <= r370020;
        double r370022 = !r370021;
        bool r370023 = r370019 || r370022;
        double r370024 = y;
        double r370025 = x;
        double r370026 = z;
        double r370027 = r370025 - r370026;
        double r370028 = r370024 * r370027;
        double r370029 = r370028 * r370017;
        double r370030 = r370027 * r370017;
        double r370031 = r370024 * r370030;
        double r370032 = r370023 ? r370029 : r370031;
        return r370032;
}

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.1
Herbie3.2
\[\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 t < -4.079248937665295e-09 or 1.2796125811076182e+112 < t

    1. Initial program 4.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified4.3

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

    if -4.079248937665295e-09 < t < 1.2796125811076182e+112

    1. Initial program 8.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.0792489376652949 \cdot 10^{-9} \lor \neg \left(t \le 1.27961258110761821 \cdot 10^{112}\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 2019198 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

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