Average Error: 7.0 → 2.5
Time: 16.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\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 -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\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 r315170 = x;
        double r315171 = y;
        double r315172 = r315170 * r315171;
        double r315173 = z;
        double r315174 = r315173 * r315171;
        double r315175 = r315172 - r315174;
        double r315176 = t;
        double r315177 = r315175 * r315176;
        return r315177;
}

double f(double x, double y, double z, double t) {
        double r315178 = t;
        double r315179 = -1.3553932494300151e-45;
        bool r315180 = r315178 <= r315179;
        double r315181 = 2.7791553523823977e-59;
        bool r315182 = r315178 <= r315181;
        double r315183 = !r315182;
        bool r315184 = r315180 || r315183;
        double r315185 = y;
        double r315186 = x;
        double r315187 = z;
        double r315188 = r315186 - r315187;
        double r315189 = r315185 * r315188;
        double r315190 = r315189 * r315178;
        double r315191 = r315188 * r315178;
        double r315192 = r315185 * r315191;
        double r315193 = r315184 ? r315190 : r315192;
        return r315193;
}

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.0
Herbie2.5
\[\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 < -1.3553932494300151e-45 or 2.7791553523823977e-59 < t

    1. Initial program 2.7

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

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

    if -1.3553932494300151e-45 < t < 2.7791553523823977e-59

    1. Initial program 10.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\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 2019199 +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))