Average Error: 7.0 → 1.4
Time: 37.6s
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(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.2122805582373037 \cdot 10^{+206}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \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(x - z\right) \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 1.2122805582373037 \cdot 10^{+206}:\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r29723849 = x;
        double r29723850 = y;
        double r29723851 = r29723849 * r29723850;
        double r29723852 = z;
        double r29723853 = r29723852 * r29723850;
        double r29723854 = r29723851 - r29723853;
        double r29723855 = t;
        double r29723856 = r29723854 * r29723855;
        return r29723856;
}

double f(double x, double y, double z, double t) {
        double r29723857 = x;
        double r29723858 = y;
        double r29723859 = r29723857 * r29723858;
        double r29723860 = z;
        double r29723861 = r29723860 * r29723858;
        double r29723862 = r29723859 - r29723861;
        double r29723863 = -inf.0;
        bool r29723864 = r29723862 <= r29723863;
        double r29723865 = r29723857 - r29723860;
        double r29723866 = t;
        double r29723867 = r29723858 * r29723866;
        double r29723868 = r29723865 * r29723867;
        double r29723869 = 1.2122805582373037e+206;
        bool r29723870 = r29723862 <= r29723869;
        double r29723871 = r29723866 * r29723862;
        double r29723872 = r29723866 * r29723865;
        double r29723873 = r29723872 * r29723858;
        double r29723874 = r29723870 ? r29723871 : r29723873;
        double r29723875 = r29723864 ? r29723868 : r29723874;
        return r29723875;
}

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.0
Target3.2
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886777 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877 \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.2

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

    if -inf.0 < (- (* x y) (* z y)) < 1.2122805582373037e+206

    1. Initial program 1.5

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

    if 1.2122805582373037e+206 < (- (* x y) (* z y))

    1. Initial program 30.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.2122805582373037 \cdot 10^{+206}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(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))