Average Error: 7.4 → 0.5
Time: 10.1s
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 \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250} \lor \neg \left(x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}\right) \land x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\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 \left(x - z\right)\right) \cdot y\\

\mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250} \lor \neg \left(x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}\right) \land x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r483921 = x;
        double r483922 = y;
        double r483923 = r483921 * r483922;
        double r483924 = z;
        double r483925 = r483924 * r483922;
        double r483926 = r483923 - r483925;
        double r483927 = t;
        double r483928 = r483926 * r483927;
        return r483928;
}

double f(double x, double y, double z, double t) {
        double r483929 = x;
        double r483930 = y;
        double r483931 = r483929 * r483930;
        double r483932 = z;
        double r483933 = r483932 * r483930;
        double r483934 = r483931 - r483933;
        double r483935 = -inf.0;
        bool r483936 = r483934 <= r483935;
        double r483937 = t;
        double r483938 = r483929 - r483932;
        double r483939 = r483937 * r483938;
        double r483940 = r483939 * r483930;
        double r483941 = -9.285466391890798e-250;
        bool r483942 = r483934 <= r483941;
        double r483943 = 1.2071468990721145e-243;
        bool r483944 = r483934 <= r483943;
        double r483945 = !r483944;
        double r483946 = 9.010117805898267e+141;
        bool r483947 = r483934 <= r483946;
        bool r483948 = r483945 && r483947;
        bool r483949 = r483942 || r483948;
        double r483950 = r483937 * r483934;
        double r483951 = r483930 * r483937;
        double r483952 = r483938 * r483951;
        double r483953 = r483949 ? r483950 : r483952;
        double r483954 = r483936 ? r483940 : r483953;
        return r483954;
}

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.4
Target3.1
Herbie0.5
\[\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. Simplified0.3

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

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

    if -inf.0 < (- (* x y) (* z y)) < -9.285466391890798e-250 or 1.2071468990721145e-243 < (- (* x y) (* z y)) < 9.010117805898267e+141

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if -9.285466391890798e-250 < (- (* x y) (* z y)) < 1.2071468990721145e-243 or 9.010117805898267e+141 < (- (* x y) (* z y))

    1. Initial program 18.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250} \lor \neg \left(x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}\right) \land x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]

Reproduce

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